Browse Source

[master] [1908] Added v6 socket binding to local-link address

Marcin Siodelski 13 years ago
parent
commit
597e059afa
1 changed files with 7 additions and 0 deletions
  1. 7 0
      tests/tools/perfdhcp/perfdhcp.c

+ 7 - 0
tests/tools/perfdhcp/perfdhcp.c

@@ -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;