]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/dnsmasq/0036-Don-t-reply-to-DHCPv6-SOLICIT-messages-when-not-conf.patch
dnsmasq: Import more upstream fixes
[ipfire-2.x.git] / src / patches / dnsmasq / 0036-Don-t-reply-to-DHCPv6-SOLICIT-messages-when-not-conf.patch
CommitLineData
6644c1c7
MT
1From 61b838dd574c51d96fef100285a0d225824534f9 Mon Sep 17 00:00:00 2001
2From: Win King Wan <pinwing+dnsmasq@gmail.com>
3Date: Wed, 21 Jan 2015 20:41:48 +0000
5f206778 4Subject: [PATCH 36/87] Don't reply to DHCPv6 SOLICIT messages when not
6644c1c7
MT
5 configured for statefull DHCPv6.
6
7---
8 CHANGELOG | 4 ++++
9 src/rfc3315.c | 13 +++++++++++++
10 2 files changed, 17 insertions(+)
11
12diff --git a/CHANGELOG b/CHANGELOG
13index 0076b557e95e..a4cb901e83ae 100644
14--- a/CHANGELOG
15+++ b/CHANGELOG
16@@ -59,6 +59,10 @@ version 2.73
17 cheaply than having dnsmasq re-read all its existing
18 configuration each time.
19
20+ Don't reply to DHCPv6 SOLICIT messages if we're not
21+ configured to do stateful DHCPv6. Thanks to Win King Wan
22+ for the patch.
23+
24
25 version 2.72
26 Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
27diff --git a/src/rfc3315.c b/src/rfc3315.c
28index ddb390bf1136..e593ec9c362c 100644
29--- a/src/rfc3315.c
30+++ b/src/rfc3315.c
31@@ -824,6 +824,19 @@ static int dhcp6_no_relay(struct state *state, int msg_type, void *inbuff, size_
32 }
33 else
34 {
35+ /* Windows 8 always requests an address even if the Managed bit
36+ in RA is 0 and it keeps retrying if it receives a reply
37+ stating that no addresses are available. We solve this
38+ by not replying at all if we're not configured to give any
39+ addresses by DHCPv6. RFC 3315 17.2.1. appears to allow this. */
40+
41+ for (c = state->context; c; c = c->current)
42+ if (!(c->flags & CONTEXT_RA_STATELESS))
43+ break;
44+
45+ if (!c)
46+ return 0;
47+
48 /* no address, return error */
49 o1 = new_opt6(OPTION6_STATUS_CODE);
50 put_opt6_short(DHCP6NOADDRS);
51--
522.1.0
53