From 43720dae5d69ba4446d4f4648d927ae4d9d179f5 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 6 Sep 2011 14:54:48 +0200 Subject: pingu_burst: try rebind every burst In case the bind failed on the got-address event. --- pingu_burst.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pingu_burst.c') diff --git a/pingu_burst.c b/pingu_burst.c index 60d30e4..2f4a55b 100644 --- a/pingu_burst.c +++ b/pingu_burst.c @@ -19,6 +19,13 @@ void ping_burst_start(struct ev_loop *loop, struct pingu_host *host) int r; char buf[64]; + /* we bind to device every burst in case an iface disappears and + comes back. e.g ppp0 */ + if (pingu_iface_bind_socket(host->iface, host->status) < 0) { + pingu_host_set_status(host, 0); + return; + } + host->burst.active = 1; host->burst.pings_sent = 0; host->burst.pings_replied = 0; -- cgit v1.2.3