* Change:
+ Fix minimal kernel version to 2.6.39. Add a runtime warning when
this is not the case.
+ + Remove old bridge code (the one using ioctl).
+ Don't discard down interfaces. Notably, this enables us to keep
their specific configuration if any.
+ For Linux, switch to libnl3. Be aware of the licensing issues in
};
#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,
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 */