summaryrefslogtreecommitdiffstats
path: root/src/plugins/cdp/cdp.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-05-29 10:19:56 -0400
committerFlorin Coras <florin.coras@gmail.com>2019-05-29 16:27:36 +0000
commitef8711b3b2aa3c25baea5bce5d0f1626aa74fc7d (patch)
tree99449ef4923e5e52daef8e8513d0c0a16018acbf /src/plugins/cdp/cdp.c
parent257573d86bae518736f76ee59066d4200cd55bd2 (diff)
Start the cdp period process on demand
Change-Id: I219b270f905dad5939ab38e933712845c314286d Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/plugins/cdp/cdp.c')
-rw-r--r--src/plugins/cdp/cdp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/cdp/cdp.c b/src/plugins/cdp/cdp.c
index 45863a096a3..2c947a74d71 100644
--- a/src/plugins/cdp/cdp.c
+++ b/src/plugins/cdp/cdp.c
@@ -63,11 +63,17 @@ cdp_enable_disable (cdp_main_t * cm, int enable_disable)
int rv = 0;
if (enable_disable)
- vlib_process_signal_event (cm->vlib_main, cdp_process_node.index,
- CDP_EVENT_ENABLE, 0);
+ {
+ vnet_cdp_create_periodic_process (cm);
+ vlib_process_signal_event (cm->vlib_main, cm->cdp_process_node_index,
+ CDP_EVENT_ENABLE, 0);
+ }
else
- vlib_process_signal_event (cm->vlib_main, cdp_process_node.index,
- CDP_EVENT_DISABLE, 0);
+ {
+ vnet_cdp_create_periodic_process (cm);
+ vlib_process_signal_event (cm->vlib_main, cm->cdp_process_node_index,
+ CDP_EVENT_DISABLE, 0);
+ }
cm->enabled = enable_disable;
return rv;