diff --git a/src/arp.c b/src/arp.c index 1b7feef..38049c0 100644 --- a/src/arp.c +++ b/src/arp.c @@ -363,12 +363,13 @@ int arp_gw_check(struct client_state_t cs[static 1]) return 0; garp.gw_check_initpings = garp.send_stats[ASEND_GW_PING].count; garp.server_replied = false; - if (arp_ping(cs, cs->srcAddr) < 0) - return -1; + int r; + if ((r = arp_ping(cs, cs->srcAddr)) < 0) + return r; if (cs->routerAddr) { garp.router_replied = false; - if (arp_ping(cs, cs->routerAddr) < 0) - return -1; + if ((r = arp_ping(cs, cs->routerAddr)) < 0) + return r; } else garp.router_replied = true; arp_switch_state(cs, AS_GW_CHECK); diff --git a/src/state.c b/src/state.c index 3618faf..593125f 100644 --- a/src/state.c +++ b/src/state.c @@ -425,13 +425,16 @@ void ifup_action(struct client_state_t cs[static 1]) if (cs->routerAddr && (cs->dhcpState == DS_BOUND || cs->dhcpState == DS_RENEWING || cs->dhcpState == DS_REBINDING)) { - if (arp_gw_check(cs) != -1) { + int r = arp_gw_check(cs); + if (r >= 0) { log_line("%s: Interface is back. Revalidating lease...", client_config.interface); return; - } else + } else { + SUSPEND_IF_NOCARRIER(); log_warning("%s: arp_gw_check could not make arp socket.", client_config.interface); + } } if (cs->dhcpState == DS_SELECTING) return;