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

List:       dhcp-client
Subject:    Trailing NULL of DHCP option string
From:       Motomichi Matsuzaki <mzaki () e-mail ! ne ! jp>
Date:       2000-09-17 19:02:58
[Download RAW message or body]

   *** From dhcp-client -- To unsubscribe, see the end of this message. ***



Hi.

RFC2132 says:

	Options containing NVT ASCII data SHOULD NOT include a trailing NULL;
	however, the receiver of such options MUST be prepared to delete
	trailing nulls if they exist.

	(RFC2132 2. BOOTP Extension/DHCP Option Field Format)

isc-dhcp 2.0pl5 client seems to violate this.


If server send domain name with a trailing NULL as follows,

0f 0a 6d 7a 61 6b 69 2e 6e 6f 6d 00
|  |  |
|  |  value: mzaki.nom\0 ( this '\0' stands for NUL character )
|  length: 10
tag: Domain Name

pretty_print_option() in common/options.c translates this into

mzaki.nom\000

and turns over to client script.


ad hoc patch is:

--- common/options.c	Sat Jun 24 16:24:02 2000
+++ /home/mzaki/options.c	Mon Sep 11 23:08:56 2000
@@ -551,6 +551,7 @@
 				if (emit_quotes)
 					*op++ = '"';
 				for (; dp < data + len; dp++) {
+					if (*dp == '\0') continue;
 					if (!isascii (*dp) ||
 					    !isprint (*dp)) {
 						sprintf (op, "\\%03o",

-- 
Motomichi Matsuzaki <mzaki@e-mail.ne.jp> 
Dept. of Biological Sciences, Grad. School of Science, Univ. of Tokyo, Japan 

-----------------------------------------------------------------------
To unsubscribe from this list, visit http://www.isc.org/dhcp-lists.html
or send mail to dhcp-client-request@isc.org with the subject line of
'unsubscribe'.
-----------------------------------------------------------------------

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

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