From 5242194ffb8053555faf94ce2e8115591d0823e4 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 25 Sep 2015 11:04:02 +0200 Subject: [PATCH] interfaces: remove old bridge code 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 | 47 +---------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/src/daemon/interfaces-linux.c b/src/daemon/interfaces-linux.c index c9342d48..7b638c1a 100644 --- a/src/daemon/interfaces-linux.c +++ b/src/daemon/interfaces-linux.c @@ -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 */ -- 2.39.5