X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fnat64_out2in.c;h=437052fc441e6782521de5411d88702387e9bf96;hb=fd0d50879f475a1b15cedb4ab49059a02c45ccfd;hp=ba35de1e2a1b33af0425a593690bbe7dd0f6ce9e;hpb=775f73c6baaf9bc2283e7ab9752c81984823be99;p=vpp.git diff --git a/src/plugins/nat/nat64_out2in.c b/src/plugins/nat/nat64_out2in.c index ba35de1e2a1..437052fc441 100644 --- a/src/plugins/nat/nat64_out2in.c +++ b/src/plugins/nat/nat64_out2in.c @@ -165,6 +165,12 @@ nat64_out2in_tcp_udp_set_cb (ip4_header_t * ip4, ip6_header_t * ip6, nat64_compose_ip6 (&ip6_saddr, &ip4->src_address, bibe->fib_index); ste = nat64_db_st_entry_create (db, bibe, &ip6_saddr, &saddr.ip4, sport); + + if (!ste) + return -1; + + vlib_set_simple_counter (&nm->total_sessions, ctx->thread_index, 0, + db->st.st_entries_num); } ip6->src_address.as_u64[0] = ste->in_r_addr.as_u64[0]; @@ -240,6 +246,12 @@ nat64_out2in_icmp_set_cb (ip4_header_t * ip4, ip6_header_t * ip6, void *arg) nat64_compose_ip6 (&ip6_saddr, &ip4->src_address, bibe->fib_index); ste = nat64_db_st_entry_create (db, bibe, &ip6_saddr, &saddr.ip4, 0); + + if (!ste) + return -1; + + vlib_set_simple_counter (&nm->total_sessions, ctx->thread_index, 0, + db->st.st_entries_num); } nat64_session_reset_timeout (ste, ctx->vm); @@ -397,6 +409,12 @@ nat64_out2in_unk_proto_set_cb (ip4_header_t * ip4, ip6_header_t * ip6, nat64_compose_ip6 (&ip6_saddr, &ip4->src_address, bibe->fib_index); ste = nat64_db_st_entry_create (db, bibe, &ip6_saddr, &saddr.ip4, 0); + + if (!ste) + return -1; + + vlib_set_simple_counter (&nm->total_sessions, ctx->thread_index, 0, + db->st.st_entries_num); } nat64_session_reset_timeout (ste, ctx->vm); @@ -802,6 +820,9 @@ nat64_out2in_reass_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, node->errors[NAT64_OUT2IN_ERROR_NO_TRANSLATION]; goto trace0; } + + vlib_set_simple_counter (&nm->total_sessions, thread_index, + 0, db->st.st_entries_num); } reass0->sess_index = nat64_db_st_entry_get_index (db, ste0); reass0->thread_index = thread_index;