From b9e2e0193bffc4d426fc8fa65e82e6ea36f997e9 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 12 Jun 2012 15:56:23 +0200 Subject: pingu_host: bring interface down instantly if interface disapears We need execute the down hook in case interface goes down if we have gre tunnels bound to an interface. If for example ppp0 disapears (pppd restart) and comes back before pingu notices it, the gre interface will not be bound to anything. So we force the "down" event instantly if we detect that the iface is gone. --- pingu_host.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pingu_host.c') 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; -- cgit v1.2.3