From b8db52bd7c7d45b47122f3824b5f1dc97c3421cf Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 30 Jan 2016 13:09:16 +0100 Subject: [PATCH] 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. --- src/daemon/interfaces-linux.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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. */ -- 2.39.5