]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Revert "Blacklist VMWare interfaces (as per ticket #40)."
authorVincent Bernat <bernat@luffy.cx>
Mon, 3 May 2010 13:27:15 +0000 (15:27 +0200)
committerVincent Bernat <bernat@luffy.cx>
Mon, 3 May 2010 13:27:15 +0000 (15:27 +0200)
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
src/interfaces.c
src/lldpd.c
src/lldpd.h

index 9a120a5973dd28574af5c7a22f4ac9c1674b2b7e..702579fa2a5fb0bbe1189e358ac82919edadc2a0 100644 (file)
--- 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)
 
index 5d01c9a7680f6854e64b892fd5094bbe159fe845..5dbf3671e3f155081a433661a65d6926be339817 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/sockios.h>
 #include <linux/filter.h>
 #include <linux/if_packet.h>
-#include <regex.h>
 
 #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)
index 09ac080931f00c92a457de702b143266bcf4b772..f2a97d1a41ff1a27093f4317301380c6151e67cf 100644 (file)
@@ -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
index 376ef0432821dba80f8c677ea1d2eee8fe2940f3..7bead7962089390851937733a275c39b0467cf2c 100644 (file)
@@ -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