From e681c859c6c90696b41ce70ebee2c22fc83f169d Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 1 Jun 2013 11:57:09 +0200 Subject: [PATCH] client: trigger interface refresh when updating interface pattern --- src/daemon/client.c | 1 + src/daemon/event.c | 7 +++++++ src/daemon/lldpd.h | 1 + 3 files changed, 9 insertions(+) diff --git a/src/daemon/client.c b/src/daemon/client.c index 08e9d428..41a13f00 100644 --- a/src/daemon/client.c +++ b/src/daemon/client.c @@ -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); diff --git a/src/daemon/event.c b/src/daemon/event.c index 2e7dced3..d603c5bf 100644 --- a/src/daemon/event.c +++ b/src/daemon/event.c @@ -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) { diff --git a/src/daemon/lldpd.h b/src/daemon/lldpd.h index 27bf0b6f..49167feb 100644 --- a/src/daemon/lldpd.h +++ b/src/daemon/lldpd.h @@ -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 *); -- 2.39.5