Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Oct 2010 16:11:31 GMT
From:      "Peter J. Philipp" <pjp@centroid.eu>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/151815: 'w' erroneously resolves truncated IPv6
Message-ID:  <201010291611.o9TGBVKf005086@www.freebsd.org>
Resent-Message-ID: <201010291620.o9TGK4ZC004284@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010291611.o9TGBVKf005086>