]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Don't listen/send LLDP packets on bridge.
authorVincent <bernat@luffy.cx>
Tue, 2 Mar 2010 17:17:04 +0000 (18:17 +0100)
committerVincent <bernat@luffy.cx>
Tue, 2 Mar 2010 17:17:04 +0000 (18:17 +0100)
A bridge, like a VLAN or a bond device is no place to listen or send
LLDP packets.

src/interfaces.c

index d549c3a4cc564133adc2ff3bbd7d35098236143d..2ba50a20c5bca388257d5e62d09368845d85ff31 100644 (file)
@@ -397,9 +397,10 @@ static int
 iface_minimal_checks(struct lldpd *cfg, struct ifaddrs *ifa)
 {
        struct sockaddr_ll *sdl;
+       int is_bridge = iface_is_bridge(cfg, ifa->ifa_name);
 
        if (!(LOCAL_CHASSIS(cfg)->c_cap_enabled & LLDP_CAP_BRIDGE) &&
-           iface_is_bridge(cfg, ifa->ifa_name)) {
+           is_bridge) {
                LOCAL_CHASSIS(cfg)->c_cap_enabled |= LLDP_CAP_BRIDGE;
                return 0;
        }
@@ -425,9 +426,10 @@ iface_minimal_checks(struct lldpd *cfg, struct ifaddrs *ifa)
        if (!(ifa->ifa_flags & (IFF_MULTICAST|IFF_BROADCAST)))
                return 0;
 
-       /* Don't handle bond and VLAN  */
+       /* Don't handle bond and VLAN, nor bridge  */
        if ((iface_is_vlan(cfg, ifa->ifa_name)) ||
-           (iface_is_bond(cfg, ifa->ifa_name)))
+           (iface_is_bond(cfg, ifa->ifa_name)) ||
+           is_bridge)
                return 0;
 
        return 1;