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.
8 src/rfc3315.c | 9 +++++----
9 1 file changed, 5 insertions(+), 4 deletions(-)
11 diff --git a/src/rfc3315.c b/src/rfc3315.c
12 index 2665d0d..3f1f9ee 100644
15 @@ -1320,15 +1320,16 @@ static struct dhcp_netid *add_options(struct state *state, int do_refresh)
17 if (opt_cfg->opt == OPTION6_REFRESH_TIME)
20 + if (opt_cfg->opt == OPTION6_DNS_SERVER)
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)
30 - if (opt_cfg->opt == OPTION6_DNS_SERVER)
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)) ||