summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2012-02-24 19:44:05 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2012-02-24 19:44:05 +0000
commita4a5205fd761f7394d37adf1a52e1335fd59e1d5 (patch)
treee92a414c4559652174ead9af03d0d7ea17458c2b
parentc5ad4e799861dc1477c25a74e800cfd4a2916bc5 (diff)
downloaddnsmasq-2.60test15.tar.gz
Fix ordering problem in multicast setup.v2.60test15
-rw-r--r--src/dhcp6.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/dhcp6.c b/src/dhcp6.c
index 3b4da60..4639d54 100644
--- a/src/dhcp6.c
+++ b/src/dhcp6.c
@@ -101,13 +101,6 @@ static int join_multicast(struct in6_addr *local, int prefix,
if (if_index == listenp->fd_or_iface)
return 1;
- mreq.ipv6mr_interface = if_index;
- inet_pton(AF_INET6, ALL_ROUTERS, &mreq.ipv6mr_multiaddr);
-
- if (daemon->icmp6fd != -1 &&
- setsockopt(daemon->icmp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
- return 0;
-
if (!indextoname(fd, if_index, ifrn_name))
return 0;
@@ -126,7 +119,9 @@ static int join_multicast(struct in6_addr *local, int prefix,
if (!context)
return 1;
-
+
+ mreq.ipv6mr_interface = if_index;
+
inet_pton(AF_INET6, ALL_RELAY_AGENTS_AND_SERVERS, &mreq.ipv6mr_multiaddr);
if (setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
@@ -137,6 +132,12 @@ static int join_multicast(struct in6_addr *local, int prefix,
if (setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
return 0;
+ inet_pton(AF_INET6, ALL_ROUTERS, &mreq.ipv6mr_multiaddr);
+
+ if (daemon->icmp6fd != -1 &&
+ setsockopt(daemon->icmp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
+ return 0;
+
listenp = whine_malloc(sizeof(struct listen_param));
listenp->fd_or_iface = if_index;
listenp->next = param->next;