some printer can not obtain IP address

Evan Hunt Evan_Hunt at isc.org
Mon Jul 28 19:44:02 UTC 2008


On Sat, Jul 26, 2008 at 02:17:43PM +0800, li jun wrote:
> Today morning,something happened strangely,all the PC can obtain IP
> address as usual from the DHCP server,but some printers can not. 

You didn't mention the version of DHCP you're running... but see if you
can apply the patch below; I suspect it'll fix the problem.

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