summaryrefslogtreecommitdiffstats
path: root/src/plugins/linux-cp/lcp.c
diff options
context:
space:
mode:
authorPim van Pelt <pim@ipng.nl>2023-10-06 11:26:33 +0200
committerMatthew Smith <mgsmith@netgate.com>2024-01-10 14:49:25 +0000
commit2c9b128e1b3732f9dd62699922480f9206a02b2d (patch)
treec298875846843f34828269346adaa02f160e3e15 /src/plugins/linux-cp/lcp.c
parent2fa69effc844d7a27d46c0f163c0840df961eb2d (diff)
linux-cp: Fix looping netlink messages
Signal when consuming a batch of netlink messages, in order to inhibit lcp_sync from generating new netlink messages. This avoids link up/down state changess from triggering an infinite loop. Do this in the regular case of nl_route_process_msgs() and in the special case of re-synchronizing in lcp_nl_recv_dump_replies(). Type: fix Change-Id: I419d3f9aa350c119b3778b644c65165cb4cc1bef Signed-off-by: Pim van Pelt <pim@ipng.nl>
Diffstat (limited to 'src/plugins/linux-cp/lcp.c')
-rw-r--r--src/plugins/linux-cp/lcp.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/linux-cp/lcp.c b/src/plugins/linux-cp/lcp.c
index 33c71e44143..561ebb152ae 100644
--- a/src/plugins/linux-cp/lcp.c
+++ b/src/plugins/linux-cp/lcp.c
@@ -145,6 +145,22 @@ lcp_get_del_dynamic_on_link_down (void)
return lcpm->del_dynamic_on_link_down;
}
+void
+lcp_set_netlink_processing_active (u8 is_processing)
+{
+ lcp_main_t *lcpm = &lcp_main;
+
+ lcpm->netlink_processing_active = (is_processing != 0);
+}
+
+u8
+lcp_get_netlink_processing_active (void)
+{
+ lcp_main_t *lcpm = &lcp_main;
+
+ return lcpm->netlink_processing_active;
+}
+
/*
* fd.io coding-style-patch-verification: ON
*