From: Vincent Bernat Date: Sat, 30 Jan 2016 12:09:16 +0000 (+0100) Subject: interfaces/linux: blacklist some drivers instead of whitelisting X-Git-Tag: 0.9.1~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8db52bd7c7d;p=thirdparty%2Flldpd.git interfaces/linux: blacklist some drivers instead of whitelisting Currently, there is no driver to blacklist. In the past, the virtualbox pseudo-interface was a good candidate but it is not used anymore. --- diff --git a/src/daemon/interfaces-linux.c b/src/daemon/interfaces-linux.c index 06694f4a..2d1faabb 100644 --- a/src/daemon/interfaces-linux.c +++ b/src/daemon/interfaces-linux.c @@ -705,11 +705,9 @@ iflinux_add_physical(struct lldpd *cfg, struct interfaces_device_list *interfaces) { struct interfaces_device *iface; - /* White-list some drivers */ + /* Blacklist some drivers */ const char * const *rif; - const char * const regular_interfaces[] = { - "dsa", - "veth", + const char * const blacklisted_interfaces[] = { NULL }; @@ -730,15 +728,16 @@ iflinux_add_physical(struct lldpd *cfg, /* Check if the driver is whitelisted */ if (iface->driver) { - for (rif = regular_interfaces; *rif; rif++) { + int skip = 0; + for (rif = blacklisted_interfaces; *rif; rif++) { if (strcmp(iface->driver, *rif) == 0) { - /* White listed! */ - log_debug("interfaces", "accept %s: whitelisted", + log_debug("interfaces", "skip %s: blacklisted driver", iface->name); - iface->type |= IFACE_PHYSICAL_T; - continue; + skip = 1; + break; } } + if (skip) continue; } /* If the interface is linked to another one, skip it too. */