summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2015-01-18 22:11:10 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2015-01-18 22:11:10 +0000
commit393415597c8b5b09558b789ab9ac238dbe3db65d (patch)
treef751fb4a0703c50b115cb474185293d55e4d79c1
parentae4624bf46b5e37ff1a9a2ba3c927e0dede95adb (diff)
downloaddnsmasq-393415597c8b5b09558b789ab9ac238dbe3db65d.tar.gz
Cope with multiple interfaces with the same LL address.
-rw-r--r--CHANGELOG4
-rw-r--r--src/auth.c5
-rw-r--r--src/util.c1
3 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 23fc6d0..bbd7e66 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -49,6 +49,10 @@ version 2.73
sometimes reasons to do it. (Step forward, GFW).
To avoid misuse, there's a hard limit on the TTL
floor of one hour. Thansk to RinSatsuki for the patch.
+
+ Cope with multiple interfaces with the same link-local
+ address. (IPv6 addresses are scoped, so this is allowed.)
+ Thanks to Cory Benfield for help with this.
version 2.72
diff --git a/src/auth.c b/src/auth.c
index a327f16..59e05d3 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -413,7 +413,10 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
peer_addr->in.sin_port = 0;
#ifdef HAVE_IPV6
else
- peer_addr->in6.sin6_port = 0;
+ {
+ peer_addr->in6.sin6_port = 0;
+ peer_addr->in6.sin6_scope_id = 0;
+ }
#endif
for (peers = daemon->auth_peers; peers; peers = peers->next)
diff --git a/src/util.c b/src/util.c
index a729f33..d532444 100644
--- a/src/util.c
+++ b/src/util.c
@@ -274,6 +274,7 @@ int sockaddr_isequal(union mysockaddr *s1, union mysockaddr *s2)
#ifdef HAVE_IPV6
if (s1->sa.sa_family == AF_INET6 &&
s1->in6.sin6_port == s2->in6.sin6_port &&
+ s1->in6.sin6_scope_id == s2->in6.sin6_scope_id &&
IN6_ARE_ADDR_EQUAL(&s1->in6.sin6_addr, &s2->in6.sin6_addr))
return 1;
#endif