From: Roy Marples Date: Tue, 31 Jan 2012 16:32:10 +0000 (+0000) Subject: Fix carrier handling on BSD for interfaces that don't support link status X-Git-Tag: v5.5.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=159cb2e6cf17d7f8f1f9770d6f2ae6a0574b7619;p=thirdparty%2Fdhcpcd.git Fix carrier handling on BSD for interfaces that don't support link status --- diff --git a/if-bsd.c b/if-bsd.c index 881b37c2..c959b5e4 100644 --- a/if-bsd.c +++ b/if-bsd.c @@ -356,9 +356,18 @@ manage_link(int fd) case LINK_STATE_DOWN: len = -1; break; + case LINK_STATE_UP: + len = 1; + break; default: - len = ~ifm->ifm_flags & - (IFF_UP | IFF_RUNNING) ? -1 : 1; + /* handle_carrier will re-load + * the interface flags and check for + * IFF_RUNNING as some drivers that + * don't handle link state also don't + * set IFF_RUNNING when this routing + * message is generated. + * As such, it is a race ...*/ + len = 0; break; } handle_carrier(len, ifm->ifm_flags, ifname);