]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
interfaces: whitelist an interface before being checking lower
authorVincent Bernat <bernat@luffy.cx>
Sun, 3 Feb 2013 08:38:19 +0000 (09:38 +0100)
committerVincent Bernat <bernat@luffy.cx>
Sun, 3 Feb 2013 08:38:19 +0000 (09:38 +0100)
Some whitelisted interfaces, like dsa, have a lower interface in
managed mode but we still want to advertise on it. Move the check for
lower interface after whitelisting.

src/daemon/interfaces-linux.c

index 3bfc2f0b32cf29e1deba4c87a6d2e5868d991db0..df8ec4631ad124fc7e4371acefc9af53690d713a 100644 (file)
@@ -741,13 +741,6 @@ iflinux_add_physical(struct lldpd *cfg,
                        continue;
                }
 
-               /* If the interface is linked to another one, skip it too. */
-               if (iface->lower) {
-                       log_debug("interfaces", "skip %s: there is a lower interface (%s)",
-                           iface->name, iface->lower->name);
-                       continue;
-               }
-
                /* Check if the driver is whitelisted */
                if (iface->driver) {
                        for (rif = regular_interfaces; *rif; rif++) {
@@ -761,6 +754,13 @@ iflinux_add_physical(struct lldpd *cfg,
                        }
                }
 
+               /* If the interface is linked to another one, skip it too. */
+               if (iface->lower) {
+                       log_debug("interfaces", "skip %s: there is a lower interface (%s)",
+                           iface->name, iface->lower->name);
+                       continue;
+               }
+
                /* Check queue len. If no queue, this usually means that this
                   is not a "real" interface. */
                if (iface->txqueue == 0) {