]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Send to all dhcp agents instead of all routers.
authorRoy Marples <roy@marples.name>
Tue, 13 Nov 2012 15:16:27 +0000 (15:16 +0000)
committerRoy Marples <roy@marples.name>
Tue, 13 Nov 2012 15:16:27 +0000 (15:16 +0000)
dhcp6.c
dhcp6.h

diff --git a/dhcp6.c b/dhcp6.c
index d31f70eb5cbed752d376f8f143cc13a2e933de18..53fcddef23650eae5ce2804b98878abedf3d446f 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -66,7 +66,7 @@
 //#define VENDOR_SPLIT
 
 static int sock = -1;
-static struct sockaddr_in6 allrouters, from;
+static struct sockaddr_in6 alldhcp, from;
 static struct msghdr sndhdr;
 static struct iovec sndiov[2];
 static unsigned char *sndbuf;
@@ -149,13 +149,13 @@ dhcp6_init(void)
        atexit(dhcp6_cleanup);
 #endif
 
-       memset(&allrouters, 0, sizeof(allrouters));
-       allrouters.sin6_family = AF_INET6;
-       allrouters.sin6_port = htons(DHCP6_SERVER_PORT);
+       memset(&alldhcp, 0, sizeof(alldhcp));
+       alldhcp.sin6_family = AF_INET6;
+       alldhcp.sin6_port = htons(DHCP6_SERVER_PORT);
 #ifdef SIN6_LEN
-       allrouters.sin6_len = sizeof(allrouters);
+       alldhcp.sin6_len = sizeof(alldhcp);
 #endif
-       if (inet_pton(AF_INET6, ALLROUTERS, &allrouters.sin6_addr.s6_addr) != 1)
+       if (inet_pton(AF_INET6, ALLDHCP, &alldhcp.sin6_addr.s6_addr) != 1)
                return -1;
 
        len = CMSG_SPACE(sizeof(struct in6_pktinfo));
@@ -633,7 +633,7 @@ dhcp6_sendmessage(struct interface *ifp, void (*callback)(void *))
        /* Update the elapsed time */
        dhcp6_updateelapsed(ifp, state->send, state->send_len);
 
-       to = allrouters;
+       to = alldhcp;
        sndhdr.msg_name = (caddr_t)&to;
        sndhdr.msg_iov[0].iov_base = (caddr_t)state->send;
        sndhdr.msg_iov[0].iov_len = state->send_len;
diff --git a/dhcp6.h b/dhcp6.h
index f3ba5cce8b2da373604fb68da99013eb2a4a7b0d..8b2c9d544b745c92525b244af1aa6f25510f08a2 100644 (file)
--- a/dhcp6.h
+++ b/dhcp6.h
@@ -30,6 +30,8 @@
 
 #include "dhcpcd.h"
 
+#define ALLDHCP "ff02::1:2"
+
 /* UDP port numbers for DHCP */
 #define DHCP6_CLIENT_PORT      546
 #define DHCP6_SERVER_PORT      547