Commit 6bd109aa authored by Simon Kelley's avatar Simon Kelley

Better job with domain for DHCPv6 information-request.

parent f7a40ec6
...@@ -224,7 +224,7 @@ char *get_domain6(struct in6_addr *addr) ...@@ -224,7 +224,7 @@ char *get_domain6(struct in6_addr *addr)
{ {
struct cond_domain *c; struct cond_domain *c;
if ((c = search_domain6(addr, daemon->cond_domain))) if (addr && (c = search_domain6(addr, daemon->cond_domain)))
return c->domain; return c->domain;
return daemon->domain_suffix; return daemon->domain_suffix;
......
...@@ -1015,6 +1015,15 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh ...@@ -1015,6 +1015,15 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
context->netid.next = NULL; context->netid.next = NULL;
state.context_tags = &context->netid; state.context_tags = &context->netid;
} }
/* Similarly, we can't determine domain from address, but if the FQDN is
given in --dhcp-host, we can use that, and failing that we can use the
unqualified configured domain, if any. */
if (state.hostname_auth)
state.send_domain = state.domain;
else
state.send_domain = get_domain6(NULL);
log6_packet(&state, "DHCPINFORMATION-REQUEST", NULL, ignore ? _("ignored") : state.hostname); log6_packet(&state, "DHCPINFORMATION-REQUEST", NULL, ignore ? _("ignored") : state.hostname);
if (ignore) if (ignore)
return 0; return 0;
......
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