]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
interfaces: convert a whitelisted interface to a physical one
authorVincent Bernat <bernat@luffy.cx>
Fri, 7 Mar 2014 09:21:15 +0000 (10:21 +0100)
committerVincent Bernat <bernat@luffy.cx>
Fri, 7 Mar 2014 09:29:37 +0000 (10:29 +0100)
The previous change didn't allow to have bonds and VLAN handled in a
sensible way in case of a whitelisted interface.

src/daemon/interfaces.c
src/daemon/lldpd.h

index 33638dd5798dd9a42b8badc32b21d9c1a9ff85a2..b1a44daac456ad0e444d64eb805cb7b2669870db 100644 (file)
@@ -173,8 +173,9 @@ interfaces_helper_whitelist(struct lldpd *cfg,
                        iface->flags = 0;
                        continue;
                case 2:
-                       log_debug("interfaces", "whitelist %s", iface->name);
-                       iface->whitelisted = 1;
+                       log_debug("interfaces", "whitelist %s (consider it as a physical interface)",
+                           iface->name);
+                       iface->type |= IFACE_PHYSICAL_T;
                        continue;
                }
        }
@@ -492,7 +493,7 @@ interfaces_helper_physical(struct lldpd *cfg,
        struct lldpd_hardware *hardware;
 
        TAILQ_FOREACH(iface, interfaces, next) {
-               if (!(iface->type & IFACE_PHYSICAL_T) && !iface->whitelisted) continue;
+               if (!(iface->type & IFACE_PHYSICAL_T)) continue;
                if (!iface->flags) continue;
 
                log_debug("interfaces", "%s is an acceptable ethernet device",
index adffaebb1f4b10a492a747cf8a4cacd60e7669ba..fa66636abcd68da6a7d72c835e7cf3c0dfa203fb 100644 (file)
@@ -335,7 +335,6 @@ struct interfaces_device {
        int   mtu;              /* MTU */
        int   type;             /* Type (see IFACE_*_T) */
        int   vlanid;           /* If a VLAN, what is the VLAN ID? */
-       int   whitelisted;      /* If the interface has been whitelisted */
        struct interfaces_device *lower; /* Lower interface (for a VLAN for example) */
        struct interfaces_device *upper; /* Upper interface (for a bridge or a bond) */