From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 29 16:20:05 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 417A010656C0 for ; Fri, 29 Oct 2010 16:20:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F00258FC18 for ; Fri, 29 Oct 2010 16:20:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9TGK4YA004285 for ; Fri, 29 Oct 2010 16:20:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9TGK4ZC004284; Fri, 29 Oct 2010 16:20:04 GMT (envelope-from gnats) Resent-Date: Fri, 29 Oct 2010 16:20:04 GMT Resent-Message-Id: <201010291620.o9TGK4ZC004284@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, "Peter J. Philipp" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E570106564A for ; Fri, 29 Oct 2010 16:11:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 5C9318FC19 for ; Fri, 29 Oct 2010 16:11:32 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o9TGBVrC005087 for ; Fri, 29 Oct 2010 16:11:31 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o9TGBVKf005086; Fri, 29 Oct 2010 16:11:31 GMT (envelope-from nobody) Message-Id: <201010291611.o9TGBVKf005086@www.freebsd.org> Date: Fri, 29 Oct 2010 16:11:31 GMT From: "Peter J. Philipp" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/151815: 'w' erroneously resolves truncated IPv6 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 16:20:05 -0000 >Number: 151815 >Category: misc >Synopsis: 'w' erroneously resolves truncated IPv6 >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 29 16:20:04 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Peter J. Philipp >Release: 8.1-RELEASE >Organization: >Environment: atlas$ uname -a FreeBSD atlas.centroid.eu 8.1-RELEASE FreeBSD 8.1-RELEASE #2: Sat Sep 11 14:24:00 CEST 2010 pjp@atlas.centroid.eu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: dione.centroid.eu has IPv6 2001:a60:f074::30 (openbsd) atlas.centroid.eu has IPv6 2001:a60:f074::25 (freebsd) caliban.centroid.eu has IPv6 2001:a60:f074::3 (off, but openbsd) when I log in from dione to atlas I see the following in netstat: atlas$ netstat -na|grep 22 tcp6 0 48 2001:a60:f074::2.22 2001:a60:f074::3.4980 ESTABLISHED netstat truncates the last nibble of the IPv6 address which is fine I can live with that (well I can't but it's out of scope of this bug report). When I do a 'who' I see: atlas$ who pjp pts/0 Oct 29 17:20 (2001:a60:f074::3) again the IPv6 is truncated and this time it's coming from utmp. When I do a 'w' I see: atlas$ w 5:56PM up 9:48, 1 user, load averages: 0.04, 0.01, 0.00 USER TTY FROM LOGIN@ IDLE WHAT pjp pts/0 caliban 5:20PM - w which shows me being logged in from caliban, but the utmp entry is truncated and it resolves that and gives a misleading output. >How-To-Repeat: use any IPv6 that gets truncated and have reverse dns for the truncated string, which will give a wrong hostname. >Fix: increase the size of UT_HOSTSIZE to fit an entire INET6_ADDRSTRLEN in it. OpenBSD has its at 256, FreeBSD's is at 16...there is room to grow and stay within acceptable values. >Release-Note: >Audit-Trail: >Unformatted: