]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Explicity test for LINK_UP so we don't delegate to downed PPP interfaces.
authorRoy Marples <roy@marples.name>
Wed, 8 Oct 2014 11:53:27 +0000 (11:53 +0000)
committerRoy Marples <roy@marples.name>
Wed, 8 Oct 2014 11:53:27 +0000 (11:53 +0000)
dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index 617c19f067fade0c89f6c229b3ce5dd8b3a63730..06311ad37592a0cb90a1a22a9b29626b43639c0f 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -2328,7 +2328,7 @@ dhcp6_delegate_prefix(struct interface *ifp)
                                if (ia->sla_len == 0) {
                                        /* no SLA configured, so lets
                                         * automate it */
-                                       if (ifd->carrier == LINK_DOWN) {
+                                       if (ifd->carrier != LINK_UP) {
                                                syslog(LOG_DEBUG,
                                                    "%s: has no carrier, cannot"
                                                    " delegate addresses",
@@ -2347,7 +2347,7 @@ dhcp6_delegate_prefix(struct interface *ifp)
                                                    IPV6_AF_DELEGATEDZERO;
                                        if (strcmp(ifd->name, sla->ifname))
                                                continue;
-                                       if (ifd->carrier == LINK_DOWN) {
+                                       if (ifd->carrier != LINK_UP) {
                                                syslog(LOG_DEBUG,
                                                    "%s: has no carrier, cannot"
                                                    " delegate addresses",
@@ -3200,7 +3200,7 @@ dhcp6_freedrop(struct interface *ifp, int drop, const char *reason)
        if (state) {
                dhcp_auth_reset(&state->auth);
                if (options & DHCPCD_RELEASE) {
-                       if (ifp->carrier != LINK_DOWN)
+                       if (ifp->carrier == LINK_UP)
                                dhcp6_startrelease(ifp);
                        unlink(state->leasefile);
                }