aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-10-21 10:50:48 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-10-22 07:07:56 +0000
commitfab239395f955365882ca6cc962c9a9909e5b3c7 (patch)
tree8ca3f7ebde4d94d5f3733e98eee42449510e12db
parent9f9e969f149e40044fee9d2e47b7dd96f3ae4dfa (diff)
lisp-gpe: register udp port only if enabled (VPP-1468)
Change-Id: I7d0930a19d927bbd7ba3fc879d5a0c8064827629 Signed-off-by: Florin Coras <fcoras@cisco.com>
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/vnet/lisp-gpe/lisp_gpe.c b/src/vnet/lisp-gpe/lisp_gpe.c
index c7b3d887cfa..66304ae344a 100644
--- a/src/vnet/lisp-gpe/lisp_gpe.c
+++ b/src/vnet/lisp-gpe/lisp_gpe.c
@@ -193,10 +193,15 @@ clib_error_t *
vnet_lisp_gpe_enable_disable (vnet_lisp_gpe_enable_disable_args_t * a)
{
lisp_gpe_main_t *lgm = &lisp_gpe_main;
+ vlib_main_t *vm = vlib_get_main ();
if (a->is_en)
{
lgm->is_en = 1;
+ udp_register_dst_port (vm, UDP_DST_PORT_lisp_gpe,
+ lisp_gpe_ip4_input_node.index, 1 /* is_ip4 */ );
+ udp_register_dst_port (vm, UDP_DST_PORT_lisp_gpe6,
+ lisp_gpe_ip6_input_node.index, 0 /* is_ip4 */ );
}
else
{
@@ -206,6 +211,8 @@ vnet_lisp_gpe_enable_disable (vnet_lisp_gpe_enable_disable_args_t * a)
/* disable all l3 ifaces */
lisp_gpe_tenant_flush ();
+ udp_unregister_dst_port (vm, UDP_DST_PORT_lisp_gpe, 0 /* is_ip4 */ );
+ udp_unregister_dst_port (vm, UDP_DST_PORT_lisp_gpe6, 1 /* is_ip4 */ );
lgm->is_en = 0;
}
@@ -612,11 +619,6 @@ lisp_gpe_init (vlib_main_t * vm)
lgm->lisp_gpe_fwd_entries =
hash_create_mem (0, sizeof (lisp_gpe_fwd_entry_key_t), sizeof (uword));
- udp_register_dst_port (vm, UDP_DST_PORT_lisp_gpe,
- lisp_gpe_ip4_input_node.index, 1 /* is_ip4 */ );
- udp_register_dst_port (vm, UDP_DST_PORT_lisp_gpe6,
- lisp_gpe_ip6_input_node.index, 0 /* is_ip4 */ );
-
lgm->lisp_stats_index_by_key =
hash_create_mem (0, sizeof (lisp_stats_key_t), sizeof (uword));
memset (&lgm->counters, 0, sizeof (lgm->counters));