networkd-link: Receive LLDP on Bridge slaves not master (#5995)
authorsjoerd-ccu <sjoerd.simons@collabora.co.uk>
Tue, 23 May 2017 07:10:59 +0000 (09:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 May 2017 07:10:59 +0000 (09:10 +0200)
LLDP should be received on bridge slaves as they're the entities
directly connected to a peer. Receiving LLDP on the bridge device makes
little sense, Linux by default even filters out LLDP going onto the
bridge device.

Flip the current logic, receive LLDP on bridge slaves don't listen for
them on the bridge itself.

src/network/networkd-link.c

index 98a5e31..69f3e12 100644 (file)
@@ -141,7 +141,10 @@ static bool link_lldp_rx_enabled(Link *link) {
         if (!link->network)
                 return false;
 
-        if (link->network->bridge)
+        /* 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))
                 return false;
 
         return link->network->lldp_mode != LLDP_MODE_NO;