summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-19 00:59:45 -0700
committerDave Barach <openvpp@barachs.net>2019-07-19 14:37:02 +0000
commitf41110df9753ca369e1e253cbacfaa3bd4de2778 (patch)
tree3f4e8ff545d72c75d004f664f3487d55d7e22149 /src
parentb4b525e0fa14d46eac4c2f44048c0488c83f0192 (diff)
ipsec: register for port 4500 at INIT
Type: fix Fixes: 41afb33 Change-Id: Iceb99ead32f1858a5b4f85911d7cb2b39cc9add5 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/ipsec/ipsec_if.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/vnet/ipsec/ipsec_if.c b/src/vnet/ipsec/ipsec_if.c
index 43997bc86c1..0b8f997dbd0 100644
--- a/src/vnet/ipsec/ipsec_if.c
+++ b/src/vnet/ipsec/ipsec_if.c
@@ -375,14 +375,8 @@ ipsec_add_del_tunnel_if_internal (vnet_main_t * vnm,
hash_set_mem_alloc (&im->ipsec6_if_pool_index_by_key, &key6,
t - im->tunnel_interfaces);
else
- {
- hash_set (im->ipsec4_if_pool_index_by_key, key4.as_u64,
- t - im->tunnel_interfaces);
- if (1 == hash_elts (im->ipsec4_if_pool_index_by_key))
- udp_register_dst_port (vlib_get_main (),
- UDP_DST_PORT_ipsec,
- ipsec4_if_input_node.index, 1);
- }
+ hash_set (im->ipsec4_if_pool_index_by_key, key4.as_u64,
+ t - im->tunnel_interfaces);
hw_if_index = vnet_register_interface (vnm, ipsec_device_class.index,
t - im->tunnel_interfaces,
@@ -433,11 +427,7 @@ ipsec_add_del_tunnel_if_internal (vnet_main_t * vnm,
if (is_ip6)
hash_unset_mem_free (&im->ipsec6_if_pool_index_by_key, &key6);
else
- {
- hash_unset (im->ipsec4_if_pool_index_by_key, key4.as_u64);
- if (0 == hash_elts (im->ipsec4_if_pool_index_by_key))
- udp_unregister_dst_port (vlib_get_main (), UDP_DST_PORT_ipsec, 1);
- }
+ hash_unset (im->ipsec4_if_pool_index_by_key, key4.as_u64);
hash_unset (im->ipsec_if_real_dev_by_show_dev, t->show_instance);
im->ipsec_if_by_sw_if_index[t->sw_if_index] = ~0;
@@ -588,6 +578,8 @@ ipsec_tunnel_if_init (vlib_main_t * vm)
ipsec_add_feature ("ip6-output", "esp6-no-crypto",
&im->esp6_no_crypto_tun_feature_index);
+ udp_register_dst_port (vlib_get_main (),
+ UDP_DST_PORT_ipsec, ipsec4_if_input_node.index, 1);
return 0;
}