From: Vincent Bernat Date: Wed, 21 May 2014 16:40:02 +0000 (+0200) Subject: lldpd: trigger regular interface refresh when changing port ID X-Git-Tag: 0.7.9~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf11ddf09817bce90d5ea04faf77ace579924af3;p=thirdparty%2Flldpd.git lldpd: trigger regular interface refresh when changing port ID We don't want to call OS-specific methods. Let's just trigger a regular interface refresh instead. --- diff --git a/src/daemon/client.c b/src/daemon/client.c index 201efff5..6407ad69 100644 --- a/src/daemon/client.c +++ b/src/daemon/client.c @@ -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) {