summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2019-11-06 09:58:18 -0500
committerOle Trøan <otroan@employees.org>2019-11-14 16:24:33 +0000
commitaa27dcb84cb312277370b77370a69b2a3596c4c5 (patch)
treedb6744ce31bbee3d4927418a4641c61d9e878381
parent320dfcf2aa8f4617b51a2bb15f3d0f93ee62d4dc (diff)
interface: send proper link/admin status in event
Type: fix Change-Id: I7cba9f911abe1ae82d8381a48f65e81b615ede76 Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
-rw-r--r--src/vnet/interface_api.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index 0dad168203d..387ef32a207 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -828,8 +828,9 @@ link_up_down_function (vnet_main_t * vm, u32 hw_if_index, u32 flags)
if (vam->link_state_process_up)
{
- enum api_events event =
- flags ? API_LINK_STATE_UP_EVENT : API_LINK_STATE_DOWN_EVENT;
+ enum api_events event = ((flags & VNET_HW_INTERFACE_FLAG_LINK_UP) ?
+ API_LINK_STATE_UP_EVENT :
+ API_LINK_STATE_DOWN_EVENT);
vlib_process_signal_event (vam->vlib_main,
link_state_process_node.index, event,
hi->sw_if_index);
@@ -849,8 +850,8 @@ admin_up_down_function (vnet_main_t * vm, u32 sw_if_index, u32 flags)
*/
if (vam->link_state_process_up)
{
- enum api_events event =
- flags ? API_ADMIN_UP_EVENT : API_ADMIN_DOWN_EVENT;
+ enum api_events event = ((flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) ?
+ API_ADMIN_UP_EVENT : API_ADMIN_DOWN_EVENT);
vlib_process_signal_event (vam->vlib_main,
link_state_process_node.index, event,
sw_if_index);