Bug 236014 - w -nn doesn't resolve hostname to ipv6 numeric if host has v4 and v6 entry.
Summary: w -nn doesn't resolve hostname to ipv6 numeric if host has v4 and v6 entry.
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.0-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-25 03:56 UTC by nistor
Modified: 2019-03-05 14:56 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nistor 2019-02-25 03:56:08 UTC
When trying to display numeric entries for hosts using 'w' it will not resolve ipv6 related hostnames to ipv6 nuemric entries if the host has the same hostname entry with resolution on v4 and v6.

For example:

nistor@spike:~> w -n nistor
10:50PM  up 43 days, 21:36, 24 users, load averages: 0.31, 0.27, 0.21
USER       TTY      FROM                                      LOGIN@  IDLE WHAT
nistor     pts/19   cpexxxxxxxxxxxx-cmxxxxxxxxxxxx.cpe.net.c Sat02PM     2 -tcsh (tcsh)
nistor     pts/32   v6host.domain.com                        10:47PM     2 -tcsh (tcsh)

whereas:
nistor@spike:~> w -nn nistor
10:50PM  up 43 days, 21:36, 24 users, load averages: 0.31, 0.27, 0.21
USER       TTY      FROM                                      LOGIN@  IDLE WHAT
nistor     pts/19   99.230.xxx.xxx                           Sat02PM     3 -tcsh (tcsh)
nistor     pts/32   v6host.domain.com                        10:47PM     3 -tcsh (tcsh)


If the host is an ipv6 host with no ipv4 resolution to it then the display works fine:

nistor@spike:~> w david
10:55PM  up 43 days, 21:41, 24 users, load averages: 0.31, 0.23, 0.19
USER       TTY      FROM                                      LOGIN@  IDLE WHAT
david      pts/12   r2.ip6.domain.com                        22Jan19  9:12 -/bin/tcsh
nistor@spike:~> w -n david
10:55PM  up 43 days, 21:41, 24 users, load averages: 0.31, 0.23, 0.19
USER       TTY      FROM                                      LOGIN@  IDLE WHAT
david      pts/5    2001:XXX:yyyy:f000::2                   22Jan19 28days alpine
Comment 1 Pedro F. Giffuni freebsd_committer freebsd_triage 2019-03-04 21:11:00 UTC
Assign to net@: it appears to be related to IPV6.
Comment 2 Hiroki Sato freebsd_committer freebsd_triage 2019-03-04 22:19:19 UTC
I guess v6host.domain.com had multiple AAAA RRs.  Is it correct?
Comment 3 nistor 2019-03-04 22:32:07 UTC
No - It had a single A and a single AAAA associated to it.
Comment 4 Hajimu UMEMOTO freebsd_committer freebsd_triage 2019-03-05 14:56:09 UTC
When the hostname has multiple A and/or AAAA RRs, w(1) doesn't resolve an IP address, to avoid ambiguity.  The utmp doesn't have any information about an IP address family.