X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fipsec%2Fipsec_tun.c;fp=src%2Fvnet%2Fipsec%2Fipsec_tun.c;h=82f5a11d26f5794b306d1aca70ceaa1665f2fe6e;hb=6f1eb484c85cfdb091cbef18252a02b3310b9aae;hp=543be8a7faaf210d900a3b5fdfb55626ec5b4ade;hpb=47c1b1c6338c2d46173f337cf69a4b0d7f27845e;p=vpp.git diff --git a/src/vnet/ipsec/ipsec_tun.c b/src/vnet/ipsec/ipsec_tun.c index 543be8a7faa..82f5a11d26f 100644 --- a/src/vnet/ipsec/ipsec_tun.c +++ b/src/vnet/ipsec/ipsec_tun.c @@ -101,14 +101,12 @@ ipsec_tun_register_nodes (ip_address_family_t af) if (0 == ipsec_tun_node_regs[af]++) { if (AF_IP4 == af) - { - ipsec_register_udp_port (UDP_DST_PORT_ipsec); - ip4_register_protocol (IP_PROTOCOL_IPSEC_ESP, - ipsec4_tun_input_node.index); - } + ip4_register_protocol (IP_PROTOCOL_IPSEC_ESP, + ipsec4_tun_input_node.index); else ip6_register_protocol (IP_PROTOCOL_IPSEC_ESP, ipsec6_tun_input_node.index); + ipsec_register_udp_port (UDP_DST_PORT_ipsec, (AF_IP4 == af)); } } @@ -119,12 +117,10 @@ ipsec_tun_unregister_nodes (ip_address_family_t af) if (0 == --ipsec_tun_node_regs[af]) { if (AF_IP4 == af) - { - ipsec_unregister_udp_port (UDP_DST_PORT_ipsec); - ip4_unregister_protocol (IP_PROTOCOL_IPSEC_ESP); - } + ip4_unregister_protocol (IP_PROTOCOL_IPSEC_ESP); else ip6_unregister_protocol (IP_PROTOCOL_IPSEC_ESP); + ipsec_unregister_udp_port (UDP_DST_PORT_ipsec, (AF_IP4 == af)); } }