]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Stop checking for IFF_RUNNING in handle_carrier as it is invalid for BSD
authorRoy Marples <roy@marples.name>
Sun, 5 Feb 2012 19:32:17 +0000 (19:32 +0000)
committerRoy Marples <roy@marples.name>
Sun, 5 Feb 2012 19:32:17 +0000 (19:32 +0000)
and should already have been checked for Linux.

dhcpcd.c

index bc2b485450f2abaa17da52c61532937918c38ad6..6b8382bc17fe23185a1bff397321298dc3d2f2d7 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -898,15 +898,16 @@ handle_carrier(int action, int flags, const char *ifname)
        }
        if (!(iface->state->options->options & DHCPCD_LINK))
                return;
-       if (action == 0)
-               carrier = carrier_status(iface);
-       else {
+
+       if (action) {
                carrier = action == 1 ? 1 : 0;
                iface->flags = flags;
-       }
+       } else
+               carrier = carrier_status(iface);
+
        if (carrier == -1)
                syslog(LOG_ERR, "%s: carrier_status: %m", ifname);
-       else if (carrier == 0 || ~iface->flags & (IFF_UP | IFF_RUNNING)) {
+       else if (carrier == 0 || ~iface->flags & IFF_UP) {
                if (iface->carrier != LINK_DOWN) {
                        iface->carrier = LINK_DOWN;
                        syslog(LOG_INFO, "%s: carrier lost", iface->name);
@@ -919,7 +920,7 @@ handle_carrier(int action, int flags, const char *ifname)
                        }
                        drop_dhcp(iface, "NOCARRIER");
                }
-       } else if (carrier == 1 && !(~iface->flags & (IFF_UP | IFF_RUNNING))) {
+       } else if (carrier == 1 && !(~iface->flags & IFF_UP)) {
                if (iface->carrier != LINK_UP) {
                        iface->carrier = LINK_UP;
                        syslog(LOG_INFO, "%s: carrier acquired", iface->name);