From e4aba837cba606f650ce7edf755eb9edac553fc6 Mon Sep 17 00:00:00 2001 From: Neil McKee Date: Thu, 30 Jul 2020 23:57:35 +0000 Subject: [PATCH] dropmon use mutex --- src/Linux/mod_dropmon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Linux/mod_dropmon.c b/src/Linux/mod_dropmon.c index 5977e352..7c888bde 100644 --- a/src/Linux/mod_dropmon.c +++ b/src/Linux/mod_dropmon.c @@ -501,8 +501,10 @@ That would allow everything to stay on the stack as it does here, which has nice SFL_DS_SET(search.dsi, 0, ifIndex, 0); SFLNotifier *notifier = UTHashGet(mdata->notifiers, &search); if(!notifier) { - notifier = sfl_agent_addNotifier(sp->agent, &search.dsi); - sfl_notifier_set_sFlowEsReceiver(notifier, HSP_SFLOW_RECEIVER_INDEX); + SEMLOCK_DO(sp->sync_agent) { + notifier = sfl_agent_addNotifier(sp->agent, &search.dsi); + sfl_notifier_set_sFlowEsReceiver(notifier, HSP_SFLOW_RECEIVER_INDEX); + } UTHashAdd(mdata->notifiers, notifier); } return notifier;