Commit 5e3e464a authored by Simon Kelley's avatar Simon Kelley

Fix behaviour of empty dhcp-option=option6:dns-server, which should inhibit sending option.

parent 3a3965ac
...@@ -1321,14 +1321,15 @@ static struct dhcp_netid *add_options(struct state *state, int do_refresh) ...@@ -1321,14 +1321,15 @@ static struct dhcp_netid *add_options(struct state *state, int do_refresh)
if (opt_cfg->opt == OPTION6_REFRESH_TIME) if (opt_cfg->opt == OPTION6_REFRESH_TIME)
done_refresh = 1; done_refresh = 1;
if (opt_cfg->flags & DHOPT_ADDR6) if (opt_cfg->opt == OPTION6_DNS_SERVER)
done_dns = 1;
/* Empty DNS_SERVER option will not set DHOPT_ADDR6 */
if ((opt_cfg->flags & DHOPT_ADDR6) || opt_cfg->opt == OPTION6_DNS_SERVER)
{ {
int len, j; int len, j;
struct in6_addr *a; struct in6_addr *a;
if (opt_cfg->opt == OPTION6_DNS_SERVER)
done_dns = 1;
for (a = (struct in6_addr *)opt_cfg->val, len = opt_cfg->len, j = 0; for (a = (struct in6_addr *)opt_cfg->val, len = opt_cfg->len, j = 0;
j < opt_cfg->len; j += IN6ADDRSZ, a++) j < opt_cfg->len; j += IN6ADDRSZ, a++)
if ((IN6_IS_ADDR_ULA_ZERO(a) && IN6_IS_ADDR_UNSPECIFIED(state->ula_addr)) || if ((IN6_IS_ADDR_ULA_ZERO(a) && IN6_IS_ADDR_UNSPECIFIED(state->ula_addr)) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment