]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
interfaces: blacklist cdc_mbim
authorVincent Bernat <vincent@bernat.im>
Tue, 14 Jun 2016 09:47:36 +0000 (11:47 +0200)
committerVincent Bernat <vincent@bernat.im>
Tue, 14 Jun 2016 09:49:44 +0000 (11:49 +0200)
This exposes a weird interface.

src/daemon/interfaces-linux.c

index 6ac428f878ccb15afddb95d6f8c656fbfdcf7828..f6b75a4207912c1a47b116bf061e097535383834 100644 (file)
@@ -717,6 +717,12 @@ iflinux_add_physical(struct lldpd *cfg,
     struct interfaces_device_list *interfaces)
 {
        struct interfaces_device *iface;
+       /* Blacklist some drivers */
+       const char * const *rif;
+       const char * const blacklisted_drivers[] = {
+               "cdc_mbim",
+               NULL
+       };
 
        TAILQ_FOREACH(iface, interfaces, next) {
                if (iface->type & (IFACE_VLAN_T|
@@ -733,6 +739,20 @@ iflinux_add_physical(struct lldpd *cfg,
                        continue;
                }
 
+               /* Check if the driver is not blacklisted */
+               if (iface->driver) {
+                       int skip = 0;
+                       for (rif = blacklisted_drivers; *rif; rif++) {
+                               if (strcmp(iface->driver, *rif) == 0) {
+                                       log_debug("interfaces", "skip %s: blacklisted driver",
+                                           iface->name);
+                                       skip = 1;
+                                       break;
+                               }
+                       }
+                       if (skip) continue;
+               }
+
                /* If the interface is linked to another one, skip it too. */
                if (iface->lower && (!iface->driver || strcmp(iface->driver, "veth"))) {
                        log_debug("interfaces", "skip %s: there is a lower interface (%s)",