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