]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Drop DHCPv6 on carrier down.
authorRoy Marples <roy@marples.name>
Fri, 12 Oct 2012 19:10:04 +0000 (19:10 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Oct 2012 19:10:04 +0000 (19:10 +0000)
Send DHCPv6 interface information.

configure.c
dhcp6.h
dhcpcd.c

index 90df5e6b2f035d5f10b0b80482542f777f362a73..f18e87bbb42fd76db42216f88b423167717f25cd 100644 (file)
@@ -380,6 +380,10 @@ send_interface(int fd, const struct interface *iface)
                if (send_interface1(fd, iface, "ROUTERADVERT") == -1)
                        retval = -1;
        }
+       if (D6_STATE_RUNNING(iface)) {
+               if (send_interface1(fd, iface, "INFORM6") == -1)
+                       retval = -1;
+       }
        return retval;
 }
 
diff --git a/dhcp6.h b/dhcp6.h
index a42f532b97672aa12e24821ea49e09601a018c69..f6af057c826254a77a747409a209d53c62473894 100644 (file)
--- a/dhcp6.h
+++ b/dhcp6.h
@@ -113,6 +113,7 @@ struct dhcp6_state {
 };
 
 #define D6_STATE(ifp) ((struct dhcp6_state *)(ifp)->if_data[IF_DATA_DHCP6])
+#define D6_STATE_RUNNING(ifp) (D6_STATE((ifp)) && D6_STATE((ifp))->new)
 #define D6_FIRST_OPTION(m)                                                    \
     ((struct dhcp6_option *)                                                  \
         ((uint8_t *)(m) + sizeof(struct dhcp6_message)))
index f98fc8f1a4a5ece67c1ac0dc09ddcd14d85232cb..cb47396213333386fe6de5cf0124c2f873cd6ecd 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -945,6 +945,7 @@ handle_carrier(int action, int flags, const char *ifname)
                        syslog(LOG_INFO, "%s: carrier lost", iface->name);
                        close_sockets(iface);
                        delete_timeouts(iface, start_expire, NULL);
+                       dhcp6_drop(iface);
                        ipv6rs_drop(iface);
                        drop_dhcp(iface, "NOCARRIER");
                }
@@ -1639,6 +1640,8 @@ handle_args(struct fd_list *fd, int argc, char **argv)
                        if (argc == 1) {
                                for (ifp = ifaces; ifp; ifp = ifp->next) {
                                        len++;
+                                       if (D6_STATE_RUNNING(ifp))
+                                               len++;
                                        if (ipv6rs_has_ra(ifp))
                                                len++;
                                }
@@ -1654,6 +1657,8 @@ handle_args(struct fd_list *fd, int argc, char **argv)
                                for (ifp = ifaces; ifp; ifp = ifp->next)
                                        if (strcmp(argv[opt], ifp->name) == 0) {
                                                len++;
+                                               if (D6_STATE_RUNNING(ifp))
+                                                       len++;
                                                if (ipv6rs_has_ra(ifp))
                                                        len++;
                                        }