]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/dnsmasq/004-fix_behaviour_of_empty_dhcp-option.patch
Merge remote-tracking branch 'ms/ipsec-subnets' into next
[ipfire-2.x.git] / src / patches / dnsmasq / 004-fix_behaviour_of_empty_dhcp-option.patch
1 From 5e3e464ac4022ee0b3794513abe510817e2cf3ca Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Tue, 25 Aug 2015 23:08:39 +0100
4 Subject: [PATCH] Fix behaviour of empty dhcp-option=option6:dns-server, which
5 should inhibit sending option.
6
7 ---
8 src/rfc3315.c | 9 +++++----
9 1 file changed, 5 insertions(+), 4 deletions(-)
10
11 diff --git a/src/rfc3315.c b/src/rfc3315.c
12 index 2665d0d..3f1f9ee 100644
13 --- a/src/rfc3315.c
14 +++ b/src/rfc3315.c
15 @@ -1320,15 +1320,16 @@ static struct dhcp_netid *add_options(struct state *state, int do_refresh)
16
17 if (opt_cfg->opt == OPTION6_REFRESH_TIME)
18 done_refresh = 1;
19 +
20 + if (opt_cfg->opt == OPTION6_DNS_SERVER)
21 + done_dns = 1;
22
23 - if (opt_cfg->flags & DHOPT_ADDR6)
24 + /* Empty DNS_SERVER option will not set DHOPT_ADDR6 */
25 + if ((opt_cfg->flags & DHOPT_ADDR6) || opt_cfg->opt == OPTION6_DNS_SERVER)
26 {
27 int len, j;
28 struct in6_addr *a;
29
30 - if (opt_cfg->opt == OPTION6_DNS_SERVER)
31 - done_dns = 1;
32 -
33 for (a = (struct in6_addr *)opt_cfg->val, len = opt_cfg->len, j = 0;
34 j < opt_cfg->len; j += IN6ADDRSZ, a++)
35 if ((IN6_IS_ADDR_ULA_ZERO(a) && IN6_IS_ADDR_UNSPECIFIED(state->ula_addr)) ||
36 --
37 1.7.10.4
38