summaryrefslogtreecommitdiffstats
path: root/src/plugins/gtpu
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2019-05-22 11:51:47 +0200
committerDave Barach <openvpp@barachs.net>2019-05-22 19:31:27 +0000
commite8964fefc7384bf5f5dbf8a9b75b9a3bb2baaeec (patch)
treeaf85b4ff129a85cf832c0ca2df03d9567ee641e2 /src/plugins/gtpu
parent42e64e9645f8a85e1143e95ffb11d538c9733089 (diff)
gtpu: don't register udp ports unless a tunnel is created
Change-Id: I2945c2a2062ee5eda78f783c55cf16c2d60f959c Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'src/plugins/gtpu')
-rw-r--r--src/plugins/gtpu/gtpu.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/gtpu/gtpu.c b/src/plugins/gtpu/gtpu.c
index c3a71ea0f79..7612055ed7f 100644
--- a/src/plugins/gtpu/gtpu.c
+++ b/src/plugins/gtpu/gtpu.c
@@ -620,6 +620,17 @@ int vnet_gtpu_add_del_tunnel
if (sw_if_indexp)
*sw_if_indexp = sw_if_index;
+ if (a->is_add)
+ {
+ /* register udp ports */
+ if (!is_ip6 && !udp_is_valid_dst_port (UDP_DST_PORT_GTPU, 1))
+ udp_register_dst_port (gtm->vlib_main, UDP_DST_PORT_GTPU,
+ gtpu4_input_node.index, /* is_ip4 */ 1);
+ if (is_ip6 && !udp_is_valid_dst_port (UDP_DST_PORT_GTPU6, 0))
+ udp_register_dst_port (gtm->vlib_main, UDP_DST_PORT_GTPU6,
+ gtpu6_input_node.index, /* is_ip4 */ 0);
+ }
+
return 0;
}
@@ -1102,11 +1113,6 @@ gtpu_init (vlib_main_t * vm)
sizeof (ip46_address_t),
sizeof (mcast_shared_t));
- udp_register_dst_port (vm, UDP_DST_PORT_GTPU,
- gtpu4_input_node.index, /* is_ip4 */ 1);
- udp_register_dst_port (vm, UDP_DST_PORT_GTPU6,
- gtpu6_input_node.index, /* is_ip4 */ 0);
-
gtm->fib_node_type = fib_node_register_new_type (&gtpu_vft);
return 0;