]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
client: trigger interface refresh when updating interface pattern
authorVincent Bernat <bernat@luffy.cx>
Sat, 1 Jun 2013 09:57:09 +0000 (11:57 +0200)
committerVincent Bernat <bernat@luffy.cx>
Sat, 1 Jun 2013 09:57:09 +0000 (11:57 +0200)
src/daemon/client.c
src/daemon/event.c
src/daemon/lldpd.h

index 08e9d428dc0b8568b366a082345605749addf25d..41a13f006e34a5fc2f7665432c4a05159e9816c2 100644 (file)
@@ -99,6 +99,7 @@ client_handle_set_configuration(struct lldpd *cfg, enum hmsg_type *type,
                log_debug("rpc", "change c_iface_pattern %s", config->c_iface_pattern);
                free(cfg->g_config.c_iface_pattern);
                cfg->g_config.c_iface_pattern = strdup(config->c_iface_pattern);
+               levent_update_now(cfg);
        }
 
        lldpd_config_cleanup(config);
index 2e7dced3b925787fd428cf6204ac5929bae9cd24..d603c5bffc9382b1147f2f51d95c51cc017d150f 100644 (file)
@@ -405,6 +405,13 @@ levent_update_and_send(evutil_socket_t fd, short what, void *arg)
        event_add(cfg->g_main_loop, &tv);
 }
 
+void
+levent_update_now(struct lldpd *cfg)
+{
+       if (cfg->g_main_loop)
+               event_active(cfg->g_main_loop, EV_TIMEOUT, 1);
+}
+
 void
 levent_send_now(struct lldpd *cfg)
 {
index 27bf0b6fd4df2ffabfb72d2bc138c24dd91434fb..49167feb952208e963debf370d138e9c9f15ab93 100644 (file)
@@ -146,6 +146,7 @@ void         levent_hardware_add_fd(struct lldpd_hardware *, int);
 void    levent_hardware_release(struct lldpd_hardware *);
 void    levent_ctl_notify(char *, int, struct lldpd_port *);
 void    levent_send_now(struct lldpd *);
+void    levent_update_now(struct lldpd *);
 int     levent_iface_subscribe(struct lldpd *, int);
 void    levent_schedule_pdu(struct lldpd_hardware *);
 void    levent_schedule_cleanup(struct lldpd *);