diff options
author | David Hankins <dhankins@isc.org> | 2007-03-27 03:49:20 +0000 |
---|---|---|
committer | David Hankins <dhankins@isc.org> | 2007-03-27 03:49:20 +0000 |
commit | d30121c7253c25b88ad186a2d9ea98b3aa7636ba (patch) | |
tree | 2efd954af49ddc75ef2cb31e32c3388c9185bb01 | |
parent | 2cb84809bef4ba899900588cbb8fe488542c63e8 (diff) | |
download | isc-dhcp-d30121c7253c25b88ad186a2d9ea98b3aa7636ba.tar.gz |
- 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. [ISC-Bugs #16762]
-rw-r--r-- | RELNOTES | 9 | ||||
-rw-r--r-- | server/dhcp.c | 42 |
2 files changed, 33 insertions, 18 deletions
@@ -92,6 +92,15 @@ and for prodding me into improving it. - A memory leak in the minires_nsendsigned() function call was repaired. Effectively, this leaked ~80 bytes per DDNS update. +- 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.5rc2 - Failover servers try harder to retransmit binding updates upon entering diff --git a/server/dhcp.c b/server/dhcp.c index b7deb59a..35648561 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -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.192.2.65 2006/08/22 17:15:56 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.192.2.66 2007/03/27 03:49:20 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1391,10 +1391,12 @@ void nak_lease (packet, cip) } /* 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]), @@ -1549,11 +1551,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 != @@ -2201,13 +2205,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])) { |