summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2006-07-17 15:16:43 +0000
committerDavid Hankins <dhankins@isc.org>2006-07-17 15:16:43 +0000
commit334bf4910f7cf24813cedf312b60cb22a7864cec (patch)
tree87af4c816649ffab2ffe986480f7870067464107
parent71b0f2cef749323abbbf747623719791ceb9ad5a (diff)
downloadisc-dhcp-334bf4910f7cf24813cedf312b60cb22a7864cec.tar.gz
- The DHCP Relay Agent Information Option / Link Selection Sub-Option
is now supported. (See RFC3527 for details). [ISC-Bugs #16251]
-rw-r--r--RELNOTES3
-rw-r--r--includes/dhcp.h1
-rw-r--r--server/dhcp.c19
-rw-r--r--server/stables.c3
4 files changed, 19 insertions, 7 deletions
diff --git a/RELNOTES b/RELNOTES
index b4b3266f..e6247cc6 100644
--- 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
diff --git a/includes/dhcp.h b/includes/dhcp.h
index cb4ac5ab..abdb8549 100644
--- a/includes/dhcp.h
+++ b/includes/dhcp.h
@@ -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
diff --git a/server/dhcp.c b/server/dhcp.c
index f9c71e95..ff3db528 100644
--- a/server/dhcp.c
+++ b/server/dhcp.c
@@ -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,
diff --git a/server/stables.c b/server/stables.c
index 5f83df49..7c7df5ca 100644
--- a/server/stables.c
+++ b/server/stables.c
@@ -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 }
};