From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 14 16:20:12 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06E3416A41C for ; Thu, 14 Jul 2005 16:20:12 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id F209943D48 for ; Thu, 14 Jul 2005 16:20:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j6EGKADF033267 for ; Thu, 14 Jul 2005 16:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j6EGKAkO033266; Thu, 14 Jul 2005 16:20:10 GMT (envelope-from gnats) Resent-Date: Thu, 14 Jul 2005 16:20:10 GMT Resent-Message-Id: <200507141620.j6EGKAkO033266@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sean Winn Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6742316A41C for ; Thu, 14 Jul 2005 16:18:05 +0000 (GMT) (envelope-from sean@dhcp194.private.gothic.net.au) Received: from dhcp194.private.gothic.net.au (home.winn.id.au [202.182.72.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7544743D46 for ; Thu, 14 Jul 2005 16:18:03 +0000 (GMT) (envelope-from sean@dhcp194.private.gothic.net.au) Received: from dhcp194.private.gothic.net.au (localhost [127.0.0.1]) by 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 (8.13.4/8.13.4) with ESMTP id j6EGGMZg000852 for ; Fri, 15 Jul 2005 02:16:22 +1000 (EST) (envelope-from sean@dhcp194.private.gothic.net.au) Received: (from sean@localhost) by dhcp194.private.gothic.net.au (8.13.4/8.13.3/Submit) id j6EGGL4S000851; Fri, 15 Jul 2005 02:16:21 +1000 (EST) (envelope-from sean) Message-Id: <200507141616.j6EGGL4S000851@dhcp194.private.gothic.net.au> Date: Fri, 15 Jul 2005 02:16:21 +1000 (EST) From: Sean Winn To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/83468: imported OpenBSD dhclient handles hostnames differently to ISC DHCP 3 - come through as hex X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sean Winn List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2005 16:20:12 -0000 >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@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: