From 0ab48ccbb1f9ae7741b26e97b86736e08ecdb8f7 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Fri, 22 Feb 2019 15:12:05 -0500 Subject: [PATCH] make notes about matching `host` only if `fixed-address` matches --- src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c b/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c index 15311549552c..c73a018380a2 100644 --- a/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c +++ b/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c @@ -1121,6 +1121,7 @@ static rlm_isc_dhcp_info_t *get_host(REQUEST *request, rlm_isc_dhcp_info_t *head { VALUE_PAIR *vp; isc_host_ether_t *ether, my_ether; + rlm_isc_dhcp_info_t *host = NULL; /* * Look up the host first by client identifier. @@ -1134,7 +1135,10 @@ static rlm_isc_dhcp_info_t *get_host(REQUEST *request, rlm_isc_dhcp_info_t *head my_client.client = &(vp->data); client = fr_hash_table_finddata(head->client_identifiers, &my_client); - if (client) return client->host; + if (client) { + host = client->host; + goto done; + } } @@ -1146,7 +1150,16 @@ static rlm_isc_dhcp_info_t *get_host(REQUEST *request, rlm_isc_dhcp_info_t *head ether = fr_hash_table_finddata(head->hosts, &my_ether); if (!ether) return NULL; - return ether->host; + host = ether->host; + +done: + /* + * @todo - check "fixed-address". This host entry should + * match ONLY if one of the addresses matches the network + * on which the client is booting. + */ + + return host; }