]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Test earlier if the interface is an Ethernet one.
authorVincent Bernat <vbernat@wanadooportails.com>
Mon, 20 Oct 2008 13:58:57 +0000 (15:58 +0200)
committerVincent Bernat <vbernat@wanadooportails.com>
Mon, 20 Oct 2008 13:58:57 +0000 (15:58 +0200)
This should avoid a bug when using deprecated bridge ioctl.

src/lldpd.c

index c9291e257274222fb445d8f9c47eba2e785b3ea7..3f4ea32e0addae1faaec9266879f8eb038cb2367 100644 (file)
@@ -1438,6 +1438,10 @@ lldpd_loop(struct lldpd *cfg)
                                }
                        }
 
+               sdl = (struct sockaddr_ll *)ifa->ifa_addr;
+               if (sdl->sll_hatype != ARPHRD_ETHER || !sdl->sll_halen)
+                       continue;
+
                if (iface_is_bridge(cfg, ifa->ifa_name)) {
                        cfg->g_lchassis.c_cap_enabled |= LLDP_CAP_BRIDGE;
                        continue;
@@ -1454,10 +1458,6 @@ lldpd_loop(struct lldpd *cfg)
                 if (!(ifa->ifa_flags & IFF_MULTICAST))
                         continue;
 
-               sdl = (struct sockaddr_ll *)ifa->ifa_addr;
-               if (sdl->sll_hatype != ARPHRD_ETHER || !sdl->sll_halen)
-                       continue;
-
                if (iface_is_wireless(cfg, ifa->ifa_name))
                        cfg->g_lchassis.c_cap_enabled |= LLDP_CAP_WLAN;