From 5b3214aabd81b74efe8d5a22d17ebbadcc1d9ac5 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 3 May 2010 15:27:15 +0200 Subject: [PATCH] Revert "Blacklist VMWare interfaces (as per ticket #40)." It seems that vnetX interfaces are also used by other virtualization solutions. From now on, we rely only on the queue len of the interface and not on the name. This reverts commit 91eb6d5df80933d089bda9543b2dbf3d97d462e1. --- CHANGELOG | 4 ++-- src/interfaces.c | 30 ------------------------------ src/lldpd.c | 1 - src/lldpd.h | 1 - 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9a120a59..702579fa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,8 +10,8 @@ lldpd (0.5.1) + Add a new output (keyvalue) for lldpctl. * Fixes: - + Ignore interface with no queue. - + Ignore VMWare interfaces. + + Ignore interface with no queue. It should filter out interfaces + like "vnet0" that would fail if we try to send something on them. lldpd (0.5.0) diff --git a/src/interfaces.c b/src/interfaces.c index 5d01c9a7..5dbf3671 100644 --- a/src/interfaces.c +++ b/src/interfaces.c @@ -34,7 +34,6 @@ #include #include #include -#include #define SYSFS_PATH_MAX 256 #define MAX_PORTS 1024 @@ -618,35 +617,6 @@ iface_fds_close(struct lldpd *cfg, struct lldpd_hardware *hardware) } } -void -lldpd_ifh_blacklist(struct lldpd *cfg, struct ifaddrs *ifap) -{ - struct ifaddrs *ifa; - const char* blacklisted[] = { - "vnet[0-9][0-9]*", - NULL - }; - const char **f; - regex_t preg; - - for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { - if (!ifa->ifa_flags) - continue; - - for (f=blacklisted; *f != NULL; f++) { - if (regcomp(&preg, *f, REG_NOSUB) != 0) - /* Should not happen */ - fatal("unable to compile a regex"); - if (regexec(&preg, ifa->ifa_name, 0, NULL, 0) == 0) { - regfree(&preg); - break; - } - regfree(&preg); - } - if (*f != NULL) - ifa->ifa_flags = 0; /* Blacklisted */ - } -} static int iface_eth_init(struct lldpd *cfg, struct lldpd_hardware *hardware) diff --git a/src/lldpd.c b/src/lldpd.c index 09ac0809..f2a97d1a 100644 --- a/src/lldpd.c +++ b/src/lldpd.c @@ -745,7 +745,6 @@ lldpd_update_localports(struct lldpd *cfg) struct ifaddrs *ifap; struct lldpd_hardware *hardware; lldpd_ifhandlers ifhs[] = { - lldpd_ifh_blacklist, /* Do not handle those interfaces */ lldpd_ifh_bond, /* Handle bond */ lldpd_ifh_eth, /* Handle classic ethernet interfaces */ #ifdef ENABLE_DOT1 diff --git a/src/lldpd.h b/src/lldpd.h index 376ef043..7bead796 100644 --- a/src/lldpd.h +++ b/src/lldpd.h @@ -404,7 +404,6 @@ int ctl_msg_pack_structure(char *, void *, unsigned int, struct hmsg *, void ** int ctl_msg_unpack_structure(char *, void *, unsigned int, struct hmsg *, void **); /* interfaces.c */ -void lldpd_ifh_blacklist(struct lldpd *, struct ifaddrs *); void lldpd_ifh_bond(struct lldpd *, struct ifaddrs *); void lldpd_ifh_eth(struct lldpd *, struct ifaddrs *); #ifdef ENABLE_DOT1 -- 2.39.5