]> git.ipfire.org Git - thirdparty/util-linux.git/commit - term-utils/agetty.8
agetty: use the "best" interface for \4 and \6
authorKarel Zak <kzak@redhat.com>
Tue, 13 May 2014 13:07:08 +0000 (15:07 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 13 May 2014 13:23:42 +0000 (15:23 +0200)
commit0f283438bfdf7b6e6e916b63a2c317d938b1463a
tree13b2371c39f5d962d71a045d343cd0263640fb91
parent9e147794ca344e2e8151fd742662cbd2977459be
agetty: use the "best" interface for \4 and \6

The issue file escape sequences \4 and \6 prints the host IP when no
interface is specified. That's useless on some virtual machines where
gethostname()+getaddrinfo() returns 127.0.0.1.

The seems better to print IP of the "best" interface (UP, RUNNING, non-LOOPBACK)
and use gethostname() as painful fallback only.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1090935
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.8
term-utils/agetty.c