bin/83468: imported OpenBSD dhclient handles hostnames differently to ISC DHCP 3 - come through as hex

Sean Winn sean at gothic.net.au
Thu Jul 14 16:20:12 GMT 2005


>Number:         83468
>Category:       bin
>Synopsis:       imported OpenBSD dhclient handles hostnames differently to ISC DHCP 3 - come through as hex
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 14 16:20:10 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Sean Winn
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD 64:68:63:70:31:39:34:2e:70:72:69:76:61:74:65:2e:67:6f:74:68:69:63:2e:6e:65:74:2e:61:75:0 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Fri Jul 15 00:18:58 EST 2005 sean at dhcp194.private.gothic.net.au:/usr/obj/usr/src/sys/NODEBUG i386


	
>Description:
	ISC dhclient changed behaviour between 2.x and 3.x, to handle 
	receiving a hostname via DHCP correctly; OpenBSD dhclient appears
	to be based on 2.x and still displays the same behaviour as 
	ISC dhclient 2.x;

	Hostname sent via ISC dhcpd 3.x: dhcp194.private.gothic.net.au
	Used on FreeBSD 4.x, 5.x system: dhcp194.private.gothic.net.au
	Used on FreeBSD CURRENT (probably RELENG_6): 64:68:63:70:31:39:34:2e:70:72:69:76:61:74:65:2e:67:6f:74:68:69:63:2e:6e:65:74:2e:61:75:0

(DHCP server uses get-lease-hostnames true so that DNS matches hostnames 
sent absolutely, if they use it)

>How-To-Repeat:
	Install a FreeBSD current machine, setting no hostname 
	in rc.conf and configuring DHCP to provide it.

>Fix:

The fix is in sbin/dhclient/options.c pretty_print_option() - hostname is 
sent with a trailing nul, and the OpenBSD dhclient pretty_print_option() 
sees the nul as a reason to pretty-print as a series of hex characters - 
later versions of ISC dhclient have:

                /* If we found no bogus characters, or the bogus
		   character we found is a trailing NUL, it's
		      okay to print this option as text. */
											      if (k == len || (k + 1 == len && data [k] == 0)) {
		      fmtbuf [l] = 't';
		      numhunk = -2;                                   

which makes hostnames come out as text. Applying the one line change restores
FreeBSD 4.x and 5.x behaviour.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list