Add error handling for un-notified carrier downs in ifup_action.
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user