]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/dnsmasq/0032-Cope-with-multiple-interfaces-with-the-same-LL-addre.patch
Merge remote-tracking branch 'earl/tor' into next
[ipfire-2.x.git] / src / patches / dnsmasq / 0032-Cope-with-multiple-interfaces-with-the-same-LL-addre.patch
CommitLineData
6644c1c7
MT
1From 393415597c8b5b09558b789ab9ac238dbe3db65d Mon Sep 17 00:00:00 2001
2From: Simon Kelley <simon@thekelleys.org.uk>
3Date: Sun, 18 Jan 2015 22:11:10 +0000
efbd3a9a 4Subject: [PATCH 32/98] Cope with multiple interfaces with the same LL address.
6644c1c7
MT
5
6---
7 CHANGELOG | 4 ++++
8 src/auth.c | 5 ++++-
9 src/util.c | 1 +
10 3 files changed, 9 insertions(+), 1 deletion(-)
11
12diff --git a/CHANGELOG b/CHANGELOG
13index 23fc6d0530cf..bbd7e6619689 100644
14--- a/CHANGELOG
15+++ b/CHANGELOG
16@@ -49,6 +49,10 @@ version 2.73
17 sometimes reasons to do it. (Step forward, GFW).
18 To avoid misuse, there's a hard limit on the TTL
19 floor of one hour. Thansk to RinSatsuki for the patch.
20+
21+ Cope with multiple interfaces with the same link-local
22+ address. (IPv6 addresses are scoped, so this is allowed.)
23+ Thanks to Cory Benfield for help with this.
24
25
26 version 2.72
27diff --git a/src/auth.c b/src/auth.c
28index a327f16d8c0b..59e05d3da38e 100644
29--- a/src/auth.c
30+++ b/src/auth.c
31@@ -413,7 +413,10 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
32 peer_addr->in.sin_port = 0;
33 #ifdef HAVE_IPV6
34 else
35- peer_addr->in6.sin6_port = 0;
36+ {
37+ peer_addr->in6.sin6_port = 0;
38+ peer_addr->in6.sin6_scope_id = 0;
39+ }
40 #endif
41
42 for (peers = daemon->auth_peers; peers; peers = peers->next)
43diff --git a/src/util.c b/src/util.c
44index a729f339e219..d532444da207 100644
45--- a/src/util.c
46+++ b/src/util.c
47@@ -274,6 +274,7 @@ int sockaddr_isequal(union mysockaddr *s1, union mysockaddr *s2)
48 #ifdef HAVE_IPV6
49 if (s1->sa.sa_family == AF_INET6 &&
50 s1->in6.sin6_port == s2->in6.sin6_port &&
51+ s1->in6.sin6_scope_id == s2->in6.sin6_scope_id &&
52 IN6_ARE_ADDR_EQUAL(&s1->in6.sin6_addr, &s2->in6.sin6_addr))
53 return 1;
54 #endif
55--
562.1.0
57