]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- The DHCP Relay Agent Information Option / Link Selection Sub-Option
authorDavid Hankins <dhankins@isc.org>
Mon, 17 Jul 2006 15:16:43 +0000 (15:16 +0000)
committerDavid Hankins <dhankins@isc.org>
Mon, 17 Jul 2006 15:16:43 +0000 (15:16 +0000)
  is now supported.  (See RFC3527 for details). [ISC-Bugs #16251]

RELNOTES
includes/dhcp.h
server/dhcp.c
server/stables.c

index b4b3266f303c518cc3b335939b115a5d10ba776d..e6247cc6f009f01a19dbbc6ba462b97c3a799220 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -119,6 +119,9 @@ and for prodding me into improving it.
   lease.  Instead, they happen on a schedule.  See 'man dhcpd.conf' for the
   min-balance and max-balance statements for more information.
 
+- The DHCP Relay Agent Information Option / Link Selection Sub-Option
+  is now supported.  (See RFC3527 for details).
+
                        Changes since 3.0.4
 
 - A warning that host statements declared within subnet or shared-network
index cb4ac5abe04d5b9de53c234ff700ac9d99c47bce..abdb854972974534be82efd8474718f11d46421a 100644 (file)
@@ -174,6 +174,7 @@ struct dhcp_packet {
 #define RAI_CIRCUIT_ID 1
 #define RAI_REMOTE_ID  2
 #define RAI_AGENT_ID   3
+#define RAI_LINK_SELECT        5
 
 /* FQDN suboptions: */
 #define FQDN_NO_CLIENT_UPDATE          1
index f9c71e950172a9c3a136a830f4f2279bb1511ecb..ff3db5285b7cbd133fedec9ab74fd031bf67e964 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.207 2006/06/19 20:39:28 shane Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.208 2006/07/17 15:16:43 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -3902,9 +3902,15 @@ int locate_network (packet)
        struct subnet *subnet = (struct subnet *)0;
        struct option_cache *oc;
 
-       /* See if there's a subnet selection option. */
-       oc = lookup_option (&dhcp_universe, packet -> options,
-                           DHO_SUBNET_SELECTION);
+       /* See if there's a Relay Agent Link Selection Option, or a
+        * Subnet Selection Option.  The Link-Select and Subnet-Select
+        * are formatted and used precisely the same, but we must prefer
+        * the link-select over the subnet-select.
+        */
+       if ((oc = lookup_option(&agent_universe, packet->options,
+                               RAI_LINK_SELECT)) == NULL)
+               oc = lookup_option(&dhcp_universe, packet->options,
+                                  DHO_SUBNET_SELECTION);
 
        /* If there's no SSO and no giaddr, then use the shared_network
           from the interface, if there is one.   If not, fail. */
@@ -3918,8 +3924,9 @@ int locate_network (packet)
                return 0;
        }
 
-       /* If there's an SSO, and it's valid, use it to figure out the
-          subnet.    If it's not valid, fail. */
+       /* If there's an option indicating link connection, and it's valid,
+        * use it to figure out the subnet.  If it's not valid, fail.
+        */
        if (oc) {
                memset (&data, 0, sizeof data);
                if (!evaluate_option_cache (&data, packet, (struct lease *)0,
index 5f83df49791dc1a8514debbc1fc79f8117d4e596..7c7df5cabc8574d2a19264f31c7501cd0f3b6567 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: stables.c,v 1.30 2006/06/15 17:49:49 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: stables.c,v 1.31 2006/07/17 15:16:43 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -178,6 +178,7 @@ static struct option agent_options[] = {
        { "remote-id", "X",                     &agent_universe,   2, 1 },
        { "agent-id", "I",                      &agent_universe,   3, 1 },
        { "DOCSIS-device-class", "L",           &agent_universe,   4, 1 },
+       { "link-selection", "I",                &agent_universe,   5, 1 },
        { NULL, NULL, NULL, 0, 0 }
 };