DHCPD missing router option in DHCPACK

Evan Hunt Evan_Hunt at isc.org
Fri Jul 18 00:27:36 UTC 2008


> Affected devices so far are limited to HP printers and Blackboard credit
> card readers; other sorts of devices on the same networks are fine.  So
> far, everyone who's mentioned their OS was running Solaris, but that might
> be a coincidence.  I have not been able to reproduce the problem locally.

So I guess I must have done the test wrong.

Inspection of the code turned up an obvious culprit: it was supposed to
*swap* the netmask and routers options (enforcing an RFC requirement
that netmask come first), but it left a step out.

I suspect this patch will fix it:

Index: common/options.c
===================================================================
RCS file: /proj/cvs/prod/DHCP/common/options.c,v
retrieving revision 1.98.2.15
diff -u -u -r1.98.2.15 options.c
--- common/options.c	4 Apr 2008 21:36:29 -0000	1.98.2.15
+++ common/options.c	18 Jul 2008 00:10:22 -0000
@@ -880,15 +880,10 @@
 		 */
 		if (priority_list[i] == DHO_SUBNET_MASK) {
 			for (ix = i - 1 ; ix >= 0 ; ix--) {
-				/* We know that anything before 'i' can only
-				 * appear once.  So shovel the options to make
-				 * room to bubble the subnet mask ahead, and
-				 * then break out of the loop, we're done.
-				 */
 				if (priority_list[ix] == DHO_ROUTERS) {
-					memmove(priority_list + ix + 1,
-					        priority_list + ix, i - ix);
+                                        /* swap */
 					priority_list[ix] = DHO_SUBNET_MASK;
+					priority_list[i] = DHO_ROUTERS;
 					break;
 				}
 			}

--
Evan Hunt -- evan_hunt at isc.org
Internet Systems Consortium, Inc.


More information about the dhcp-users mailing list