]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpd: trigger regular interface refresh when changing port ID
authorVincent Bernat <vincent@bernat.im>
Wed, 21 May 2014 16:40:02 +0000 (18:40 +0200)
committerVincent Bernat <vincent@bernat.im>
Wed, 21 May 2014 16:40:02 +0000 (18:40 +0200)
We don't want to call OS-specific methods. Let's just trigger a regular
interface refresh instead.

src/daemon/client.c

index 201efff565c3db79c59985f78350cd09bcbf0d61..6407ad69b60507f9d476d1edce7208c73a17419e 100644 (file)
@@ -42,32 +42,6 @@ client_handle_get_configuration(struct lldpd *cfg, enum hmsg_type *type,
        return output_len;
 }
 
-/* Change the PortID Subtype configuration for all interfaces */
-void
-portid_subtype_update(struct lldpd *cfg)
-{
-       struct lldpd_hardware *hardware;
-       struct interfaces_device_list *interfaces;
-       struct interfaces_address_list *addresses;
-       struct interfaces_device *iface;
-       interfaces = netlink_get_interfaces();
-       addresses = netlink_get_addresses();
-
-       if (interfaces == NULL || addresses == NULL) {
-               log_warnx("interfaces", "cannot update the list of local interfaces");
-               return;
-       }
-        log_debug("interfaces", "portid_subtype_update called....");
-       TAILQ_FOREACH(iface, interfaces, next) {
-               if ((hardware = lldpd_get_hardware(cfg, iface->name,
-                                               iface->index,NULL)) == NULL)
-                       continue;
-
-                /* do some port->p_id and port->p_descr settings so we get updates */
-               interfaces_helper_port_name_desc(cfg, hardware, iface);
-       }
-}
-
 /* Change the global configuration */
 static int
 client_handle_set_configuration(struct lldpd *cfg, enum hmsg_type *type,
@@ -106,8 +80,7 @@ client_handle_set_configuration(struct lldpd *cfg, enum hmsg_type *type,
             log_debug("rpc", "change lldp portid tlv subtype to %d",
                       config->c_lldp_portid_type);
             cfg->g_config.c_lldp_portid_type = config->c_lldp_portid_type;
-            /* update the interfaces since our portid type has changed */
-            portid_subtype_update(cfg);
+           levent_update_now(cfg);
        }
        /* Pause/resume */
        if (config->c_paused != cfg->g_config.c_paused) {