]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
interfaces: remove old bridge code
authorVincent Bernat <vincent@bernat.im>
Fri, 25 Sep 2015 09:04:02 +0000 (11:04 +0200)
committerVincent Bernat <vincent@bernat.im>
Fri, 25 Sep 2015 09:13:15 +0000 (11:13 +0200)
It has been ages since sysfs contains the interface for querying a
bridge (2.6.7). And nowadays, sysfs is always enabled.

src/daemon/interfaces-linux.c

index c9342d48a77e3737119985f95b27b41e1052282c..7b638c1a39c091b845a0610f2da5a37a686c434b 100644 (file)
@@ -112,51 +112,6 @@ static struct lldpd_ops eth_ops = {
 };
 
 #ifdef ENABLE_OLDIES
-static int
-old_iflinux_is_bridge(struct lldpd *cfg,
-    struct interfaces_device_list *interfaces,
-    struct interfaces_device *iface)
-{
-       int j;
-       int ifptindices[MAX_PORTS] = {};
-       unsigned long args2[4] = {
-               BRCTL_GET_PORT_LIST,
-               (unsigned long)ifptindices,
-               MAX_PORTS,
-               0
-       };
-       struct ifreq ifr = {
-               .ifr_data = (char*)&args2
-       };
-
-       strlcpy(ifr.ifr_name, iface->name, IFNAMSIZ);
-
-       if (ioctl(cfg->g_sock, SIOCDEVPRIVATE, &ifr) < 0)
-               /* This can happen with a 64bit kernel and 32bit
-                  userland, don't output anything about this to avoid
-                  to fill logs. */
-               return 0;
-
-       for (j = 0; j < MAX_PORTS; j++) {
-               struct interfaces_device *port;
-               if (!ifptindices[j]) continue;
-               port = interfaces_indextointerface(interfaces, ifptindices[j]);
-               if (!port) continue;
-               if (port->upper) {
-                       log_debug("interfaces",
-                           "strange, port %s for bridge %s already has upper interface %s",
-                           port->name, iface->name, port->upper->name);
-               } else {
-                       log_debug("interfaces",
-                           "port %s is bridged to %s",
-                           port->name, iface->name);
-                       port->upper = iface;
-               }
-       }
-       return 1;
-}
-#endif
-
 static int
 iflinux_is_bridge(struct lldpd *cfg,
     struct interfaces_device_list *interfaces,
@@ -172,7 +127,7 @@ iflinux_is_bridge(struct lldpd *cfg,
                    iface->name)) >= SYSFS_PATH_MAX)
                log_warnx("interfaces", "path truncated");
        if ((f = priv_open(path)) < 0)
-               return old_iflinux_is_bridge(cfg, interfaces, iface);
+               return 0;
        close(f);
 
        /* Also grab all ports */