]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: don't do lldp rx nor tx on bond devices
authorLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 13:18:18 +0000 (15:18 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 18:01:30 +0000 (20:01 +0200)
Fixes: #15146
src/network/networkd-lldp-rx.c
src/network/networkd-lldp-tx.c

index 0631cc96a0bfa0a71ec0c97b58c477f922725ac5..fe8877797719516e7cef4ee895f6ae94b7adb15f 100644 (file)
@@ -12,6 +12,7 @@
 #include "networkd-network.h"
 #include "string-table.h"
 #include "string-util.h"
+#include "strv.h"
 #include "tmpfile-util.h"
 
 DEFINE_CONFIG_PARSE_ENUM(config_parse_lldp_mode, lldp_mode, LLDPMode, "Failed to parse LLDP= setting.");
@@ -36,10 +37,10 @@ bool link_lldp_rx_enabled(Link *link) {
         if (!link->network)
                 return false;
 
-        /* LLDP should be handled on bridge slaves as those have a direct
-         * connection to their peers not on the bridge master. Linux doesn't
-         * even (by default) forward lldp packets to the bridge master.*/
-        if (streq_ptr("bridge", link->kind))
+        /* LLDP should be handled on bridge and bond slaves as those have a direct connection to their peers,
+         * not on the bridge/bond master. Linux doesn't even (by default) forward lldp packets to the bridge
+         * master.*/
+        if (link->kind && STR_IN_SET(link->kind, "bridge", "bond"))
                 return false;
 
         return link->network->lldp_mode != LLDP_MODE_NO;
index 1fbf9d0dd9161657cce39dfabcaca3c0e1452e4d..f2d4e6f2bbb15a20ddcf5afe01a1bba5c9035df7 100644 (file)
@@ -6,8 +6,8 @@
 #include <net/if_arp.h>
 
 #include "alloc-util.h"
-#include "escape.h"
 #include "env-file.h"
+#include "escape.h"
 #include "fd-util.h"
 #include "hostname-util.h"
 #include "missing_network.h"
@@ -18,6 +18,7 @@
 #include "random-util.h"
 #include "socket-util.h"
 #include "string-util.h"
+#include "strv.h"
 #include "unaligned.h"
 #include "web-util.h"
 
@@ -54,6 +55,9 @@ bool link_lldp_emit_enabled(Link *link) {
         if (!link->network)
                 return false;
 
+        if (link->kind && STR_IN_SET(link->kind, "bridge", "bond"))
+                return false;
+
         return link->network->lldp_emit != LLDP_EMIT_NO;
 }