]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/dnsmasq/004-fix_behaviour_of_empty_dhcp-option.patch
bird: New package
[ipfire-2.x.git] / src / patches / dnsmasq / 004-fix_behaviour_of_empty_dhcp-option.patch
CommitLineData
f62ac322
MF
1From 5e3e464ac4022ee0b3794513abe510817e2cf3ca Mon Sep 17 00:00:00 2001
2From: Simon Kelley <simon@thekelleys.org.uk>
3Date: Tue, 25 Aug 2015 23:08:39 +0100
4Subject: [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
11diff --git a/src/rfc3315.c b/src/rfc3315.c
12index 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--
371.7.10.4
38