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);
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,
BV (clib_bihash_instantiate) (h);
BV (clib_bihash_alloc_unlock) (h);
}
+#else
+ /* Debug image: make sure the table has been instantiated */
+ ASSERT (h->instantiated != 0);
#endif
b = BV (clib_bihash_get_bucket) (h, hash);