X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fnat.c;h=30238f9d62f01c1a957ab614a0a22bb2852dbf3e;hb=a90ba644b2c5463b89a91d019b3c22780242acc3;hp=8ba276bc9b4591820dfa2eff23077dfe6c870870;hpb=843ea7c3e356b6e9353f9f275976f2fee23beeac;p=vpp.git diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c index 8ba276bc9b4..30238f9d62f 100755 --- a/src/plugins/nat/nat.c +++ b/src/plugins/nat/nat.c @@ -330,8 +330,9 @@ nat_free_session_data (snat_main_t * sm, snat_session_t * s, u32 thread_index, bihash_key.k.src_address = s->out2in.addr.as_u32; bihash_key.k.src_port = s->out2in.port; bihash_key.k.protocol = s->out2in.protocol; - clib_bihash_add_del_16_8 (&sm->ed_ext_ports, &bihash_key.kv, - 0 /* is_add */ ); + if (sm->ed_ext_ports.instantiated) + clib_bihash_add_del_16_8 (&sm->ed_ext_ports, &bihash_key.kv, + 0 /* is_add */ ); snat_free_outside_address_and_port (sm->addresses, thread_index, &s->out2in); @@ -465,8 +466,9 @@ nat44_free_session_data (snat_main_t * sm, snat_session_t * s, bihash_key.k.src_address = s->out2in.addr.as_u32; bihash_key.k.src_port = s->out2in.port; bihash_key.k.protocol = s->out2in.protocol; - clib_bihash_add_del_16_8 (&sm->ed_ext_ports, &bihash_key.kv, - 0 /* is_add */ ); + if (sm->ed_ext_ports.instantiated) + clib_bihash_add_del_16_8 (&sm->ed_ext_ports, &bihash_key.kv, + 0 /* is_add */ ); // should be called for every dynamic session snat_free_outside_address_and_port (sm->addresses, thread_index,