[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dhcp-users
Subject:    Re: some printer can not obtain IP address
From:       Evan Hunt <Evan_Hunt () isc ! org>
Date:       2008-07-28 19:44:02
Message-ID: 20080728194402.GB8870 () isc ! org
[Download RAW message or body]

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@isc.org
Internet Systems Consortium, Inc.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic