diff options
-rw-r--r-- | pingu_host.c | 8 | ||||
-rw-r--r-- | pingu_host.h | 1 | ||||
-rw-r--r-- | pingu_netlink.c | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/pingu_host.c b/pingu_host.c index be44343..f7695c4 100644 --- a/pingu_host.c +++ b/pingu_host.c @@ -139,6 +139,14 @@ int pingu_host_init(struct ev_loop *loop) return 0; } +void pingu_host_iface_deleted(struct pingu_iface *iface) +{ + struct pingu_host *host; + list_for_each_entry(host, &host_list, host_list_entry) + if (host->iface == iface) + pingu_host_set_status(host, 0); +} + void pingu_host_cleanup(void) { struct pingu_host *host, *n; diff --git a/pingu_host.h b/pingu_host.h index a1d4b38..4f4c341 100644 --- a/pingu_host.h +++ b/pingu_host.h @@ -39,6 +39,7 @@ int pingu_host_set_status(struct pingu_host *host, int status); int pingu_host_init(struct ev_loop *loop); int pingu_host_verify_status(struct ev_loop *loop, struct pingu_host *host); void pingu_host_dump_status(int fd, char *filter); +void pingu_host_iface_deleted(struct pingu_iface *iface); void pingu_host_cleanup(void); #endif diff --git a/pingu_netlink.c b/pingu_netlink.c index 1dec0c0..e3afbf6 100644 --- a/pingu_netlink.c +++ b/pingu_netlink.c @@ -560,6 +560,7 @@ static void netlink_link_del_cb(struct nlmsghdr *msg) log_info("Interface '%s' deleted", ifname); iface->index = 0; iface->has_link = 0; + pingu_host_iface_deleted(iface); } static void netlink_addr_new_cb(struct nlmsghdr *msg) |