Zbigniew Jędrzejewski-Szmek f4a676
From 3aeb9ea17c3f3d84077c3bb2367835d96fd57432 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek f4a676
From: sjoerd-ccu <sjoerd.simons@collabora.co.uk>
Zbigniew Jędrzejewski-Szmek f4a676
Date: Tue, 23 May 2017 09:10:59 +0200
Zbigniew Jędrzejewski-Szmek f4a676
Subject: [PATCH] networkd-link: Receive LLDP on Bridge slaves not master
Zbigniew Jędrzejewski-Szmek f4a676
 (#5995)
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
LLDP should be received on bridge slaves as they're the entities
Zbigniew Jędrzejewski-Szmek f4a676
directly connected to a peer. Receiving LLDP on the bridge device makes
Zbigniew Jędrzejewski-Szmek f4a676
little sense, Linux by default even filters out LLDP going onto the
Zbigniew Jędrzejewski-Szmek f4a676
bridge device.
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
Flip the current logic, receive LLDP on bridge slaves don't listen for
Zbigniew Jędrzejewski-Szmek f4a676
them on the bridge itself.
Zbigniew Jędrzejewski-Szmek f4a676
(cherry picked from commit 764febc23ee9a22fa64981adb0be901f964df93d)
Zbigniew Jędrzejewski-Szmek f4a676
---
Zbigniew Jędrzejewski-Szmek f4a676
 src/network/networkd-link.c | 5 ++++-
Zbigniew Jędrzejewski-Szmek f4a676
 1 file changed, 4 insertions(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
Zbigniew Jędrzejewski-Szmek f4a676
index c37bc7f602..b1282931f3 100644
Zbigniew Jędrzejewski-Szmek f4a676
--- a/src/network/networkd-link.c
Zbigniew Jędrzejewski-Szmek f4a676
+++ b/src/network/networkd-link.c
Zbigniew Jędrzejewski-Szmek f4a676
@@ -131,7 +131,10 @@ static bool link_lldp_rx_enabled(Link *link) {
Zbigniew Jędrzejewski-Szmek f4a676
         if (!link->network)
Zbigniew Jędrzejewski-Szmek f4a676
                 return false;
Zbigniew Jędrzejewski-Szmek f4a676
 
Zbigniew Jędrzejewski-Szmek f4a676
-        if (link->network->bridge)
Zbigniew Jędrzejewski-Szmek f4a676
+        /* LLDP should be handled on bridge slaves as those have a direct
Zbigniew Jędrzejewski-Szmek f4a676
+         * connection to their peers not on the bridge master. Linux doesn't
Zbigniew Jędrzejewski-Szmek f4a676
+         * even (by default) forward lldp packets to the bridge master.*/
Zbigniew Jędrzejewski-Szmek f4a676
+        if (streq_ptr("bridge", link->kind))
Zbigniew Jędrzejewski-Szmek f4a676
                 return false;
Zbigniew Jędrzejewski-Szmek f4a676
 
Zbigniew Jędrzejewski-Szmek f4a676
         return link->network->lldp_mode != LLDP_MODE_NO;