]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/patches/dnsmasq/0032-Cope-with-multiple-interfaces-with-the-same-LL-addre.patch
dnsmasq: Import latest git version of dnsmasq
[ipfire-2.x.git] / src / patches / dnsmasq / 0032-Cope-with-multiple-interfaces-with-the-same-LL-addre.patch
diff --git a/src/patches/dnsmasq/0032-Cope-with-multiple-interfaces-with-the-same-LL-addre.patch b/src/patches/dnsmasq/0032-Cope-with-multiple-interfaces-with-the-same-LL-addre.patch
new file mode 100644 (file)
index 0000000..81b02cc
--- /dev/null
@@ -0,0 +1,57 @@
+From 393415597c8b5b09558b789ab9ac238dbe3db65d Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Sun, 18 Jan 2015 22:11:10 +0000
+Subject: [PATCH 32/55] Cope with multiple interfaces with the same LL address.
+
+---
+ CHANGELOG  | 4 ++++
+ src/auth.c | 5 ++++-
+ src/util.c | 1 +
+ 3 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 23fc6d0530cf..bbd7e6619689 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 a327f16d8c0b..59e05d3da38e 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 a729f339e219..d532444da207 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
+-- 
+2.1.0
+