Commit 53c4c5c8 authored by René van Dorst's avatar René van Dorst Committed by Simon Kelley

Fix crash at startup when dhcp-host with client-ids is present.

parent dc27e148
...@@ -315,8 +315,9 @@ struct dhcp_config *find_config(struct dhcp_config *configs, ...@@ -315,8 +315,9 @@ struct dhcp_config *find_config(struct dhcp_config *configs,
return config; return config;
/* dhcpcd prefixes ASCII client IDs by zero which is wrong, but we try and /* dhcpcd prefixes ASCII client IDs by zero which is wrong, but we try and
cope with that here */ cope with that here. This is IPv4 only. context==NULL implies IPv4,
if (!(context->flags & CONTEXT_V6) && *clid == 0 && config->clid_len == clid_len-1 && see lease_update_from_configs() */
if ((!context || !(context->flags & CONTEXT_V6)) && *clid == 0 && config->clid_len == clid_len-1 &&
memcmp(config->clid, clid+1, clid_len-1) == 0 && memcmp(config->clid, clid+1, clid_len-1) == 0 &&
is_config_in_context(context, config)) is_config_in_context(context, config))
return config; return config;
......
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