]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
make notes about matching `host` only if `fixed-address` matches
authorAlan T. DeKok <aland@freeradius.org>
Fri, 22 Feb 2019 20:12:05 +0000 (15:12 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 22 Feb 2019 20:12:05 +0000 (15:12 -0500)
src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c

index 15311549552ce5a1242cf1806bed6f8706800a44..c73a018380a254279106bc583125204b15b3acbe 100644 (file)
@@ -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;
 }