]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- In the case where an "L2" DHCP Relay Agent (one that does not set giaddr)
authorDavid Hankins <dhankins@isc.org>
Tue, 27 Mar 2007 03:48:06 +0000 (03:48 +0000)
committerDavid Hankins <dhankins@isc.org>
Tue, 27 Mar 2007 03:48:06 +0000 (03:48 +0000)
  was directly attached to the same broadcast domain as the DHCP server,
  the RFC3046 relay agent information option was not being returned to the
  relay in the server's replies.  This was fixed; the dhcp server no longer
  requires the giaddr to reply with relay agent information.  Note that
  this also improves compatibility with L2 devices that "intercept" DHCP
  packets and expect relay agent information even in unicast (renewal)
  replies. [ISC-Bugs #16762]

RELNOTES
server/dhcp.c

index f44956cfba92e1e823994bcaf3b860982282f85f..ea27121f4b04a0cc7cde9f8386bce12da861176f 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -198,7 +198,16 @@ the README file.
 - A memory leak in the minires_nsendsigned() function call was repaired.
   Effectively, this leaked ~80 bytes per DDNS update.
 
-                        Changes since 3.0.5rc1
+- In the case where an "L2" DHCP Relay Agent (one that does not set giaddr)
+  was directly attached to the same broadcast domain as the DHCP server,
+  the RFC3046 relay agent information option was not being returned to the
+  relay in the server's replies.  This was fixed; the dhcp server no longer
+  requires the giaddr to reply with relay agent information.  Note that
+  this also improves compatibility with L2 devices that "intercept" DHCP
+  packets and expect relay agent information even in unicast (renewal)
+  replies.
+
+                       Changes since 3.0.5rc1
 
 - A bug was repaired in fixes to the dhclient, which sought to run the
   dhclient-script with the 'EXPIRE' state should it receive a NAK in
index 288dc965d0c20b1d09d54f76462c8d611326ef3f..b19e491eb6b0a2539442b46decbc2630d84f5784 100644 (file)
@@ -3,7 +3,7 @@
    DHCP Protocol engine. */
 
 /*
- * Copyright (c) 2004-2006 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.213 2006/10/17 20:45:59 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.214 2007/03/27 03:48:06 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1331,10 +1331,12 @@ void nak_lease (packet, cip)
        get_server_source_address(&from, options, packet);
 
        /* If there were agent options in the incoming packet, return
-          them. */
-       if (packet -> raw -> giaddr.s_addr &&
-           packet -> options -> universe_count > agent_universe.index &&
-           packet -> options -> universes [agent_universe.index]) {
+        * them.  We do not check giaddr to detect the presence of a
+        * relay, as this excludes "l2" relay agents which have no
+        * giaddr to set.
+        */
+       if (packet->options->universe_count > agent_universe.index &&
+           packet->options->universes [agent_universe.index]) {
                option_chain_head_reference
                    ((struct option_chain_head **)
                     &(options -> universes [agent_universe.index]),
@@ -1492,11 +1494,13 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
                state -> got_server_identifier = 1;
 
        /* If there were agent options in the incoming packet, return
-          them.  Do not return the agent options if they were stashed
-          on the lease. */
-       if (packet -> raw -> giaddr.s_addr &&
-           packet -> options -> universe_count > agent_universe.index &&
-           packet -> options -> universes [agent_universe.index] &&
+        * them.  Do not return the agent options if they were stashed
+        * on the lease.  We do not check giaddr to detect the presence of
+        * a relay, as this excludes "l2" relay agents which have no giaddr
+        * to set.
+        */
+       if (packet->options->universe_count > agent_universe.index &&
+           packet->options->universes [agent_universe.index] &&
            (state -> options -> universe_count <= agent_universe.index ||
             !state -> options -> universes [agent_universe.index]) &&
            lease -> agent_options !=
@@ -2244,13 +2248,15 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
                                             lease -> agent_options, MDL);
 
        /* If we got relay agent information options, and the packet really
-          looks like it came through a relay agent, and if this feature is
-          not disabled, save the relay agent information options that came
-          in with the packet, so that we can use them at renewal time when
-          the packet won't have gone through a relay agent. */
-       if (packet -> raw -> giaddr.s_addr &&
-           packet -> options -> universe_count > agent_universe.index &&
-           packet -> options -> universes [agent_universe.index] &&
+        * looks like it came through a relay agent, and if this feature is
+        * not disabled, save the relay agent information options that came
+        * in with the packet, so that we can use them at renewal time when
+        * the packet won't have gone through a relay agent.  We do not
+        * check giaddr to detect the presence of a relay, as this excludes
+        * "l2" relay agents which have no giaddr to set.
+        */
+       if (packet->options->universe_count > agent_universe.index &&
+           packet->options->universes [agent_universe.index] &&
            (state -> options -> universe_count <= agent_universe.index ||
             state -> options -> universes [agent_universe.index] ==
             packet -> options -> universes [agent_universe.index])) {