Putative fix to crash in IPv4 DHCP, introduced whilst
generalising the DHCP option filter code:
don't match options against context tag when
context->netid.net == NULL, since there's no tag then.
diff --git a/src/dhcp-common.c b/src/dhcp-common.c
index 2e40447..6de8e61 100644
--- a/src/dhcp-common.c
+++ b/src/dhcp-common.c
@@ -102,7 +102,7 @@
}
/* now flag options which are valid, including the context tags,
- otherwise valid options are inhibited if we found a higher priotity one above */
+ otherwise valid options are inhibited if we found a higher priority one above */
if (context_tags)
{
struct dhcp_netid *last_tag;
diff --git a/src/lease.c b/src/lease.c
index b2236c0..57fde0f 100644
--- a/src/lease.c
+++ b/src/lease.c
@@ -504,10 +504,9 @@
if (!(context->flags & (CONTEXT_STATIC | CONTEXT_PROXY)))
for (lease = leases; lease; lease = lease->next)
{
-#ifdef HAVE_DHCP6
if (!(lease->flags & (LEASE_TA | LEASE_NA)))
continue;
-#endif
+
if (is_same_net6((struct in6_addr *)lease->hwaddr, &context->start6, 64) &&
addr6part((struct in6_addr *)lease->hwaddr) > addr6part(&context->start6) &&
addr6part((struct in6_addr *)lease->hwaddr) <= addr6part(&context->end6) &&
diff --git a/src/rfc2131.c b/src/rfc2131.c
index 247d698..0dc06ab 100644
--- a/src/rfc2131.c
+++ b/src/rfc2131.c
@@ -2095,7 +2095,8 @@
struct dhcp_netid_list *id_list;
/* filter options based on tags, those we want get DHOPT_TAGOK bit set */
- tagif = option_filter(netid, &context->netid, config_opts);
+ context->netid.next = NULL;
+ tagif = option_filter(netid, context->netid.net ? &context->netid : NULL, config_opts);
/* logging */
if (option_bool(OPT_LOG_OPTS) && req_options)