diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-09-06 14:54:48 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-09-06 14:54:48 +0200 |
commit | 43720dae5d69ba4446d4f4648d927ae4d9d179f5 (patch) | |
tree | c5a7cfc2b437a1505e46622c86dd9f3d343ea8b2 /pingu_burst.c | |
parent | 6badfc2d0e45b54e1a5a3d53de5aad9eec428c2e (diff) | |
download | pingu-43720dae5d69ba4446d4f4648d927ae4d9d179f5.tar.bz2 pingu-43720dae5d69ba4446d4f4648d927ae4d9d179f5.tar.xz |
pingu_burst: try rebind every burst
In case the bind failed on the got-address event.
Diffstat (limited to 'pingu_burst.c')
-rw-r--r-- | pingu_burst.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |