]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] [1908] Added v6 socket binding to local-link address
authorMarcin Siodelski <marcin@isc.org>
Sat, 28 Apr 2012 19:46:34 +0000 (21:46 +0200)
committerMarcin Siodelski <marcin@isc.org>
Sat, 28 Apr 2012 19:46:34 +0000 (21:46 +0200)
tests/tools/perfdhcp/perfdhcp.c

index ba115cc49ade5105ae82ef6534e8cc06a0b0b8bf..1d533a7f07446cc4e28169d36d57c9f57bcf9fba 100644 (file)
@@ -1236,6 +1236,13 @@ getsock6(void)
                perror("socket");
                exit(1);
        }
+       ret = bind(sock,
+                  (struct sockaddr *) &localaddr,
+                  sizeof(struct sockaddr_in6));
+       if (ret < 0) {
+               perror("Failed to bind v6 socket to local-link address");
+               exit(1);
+       }
        /* perform the multicast stuff when the destination is multicast */
        if (IN6_IS_ADDR_MULTICAST(&s6->sin6_addr)) {
                int hops = 1;