From 0f283438bfdf7b6e6e916b63a2c317d938b1463a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 13 May 2014 15:07:08 +0200 Subject: 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 --- term-utils/agetty.8 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'term-utils/agetty.8') diff --git a/term-utils/agetty.8 b/term-utils/agetty.8 index ad0bfa02b..5fd80858f 100644 --- a/term-utils/agetty.8 +++ b/term-utils/agetty.8 @@ -305,12 +305,13 @@ followed by one of the letters explained below. .TP 4 or 4{interface} -Insert the IPv4 address of the machine hostname or IPv4 address the configured -network interface if the interface argument is specified (e.g. \\4{eth0}). +Insert the IPv4 address the specified network interface (e.g. \\4{eth0}) +and if the interface argument is not specified then select the first fully +configured (UP, non-LOCALBACK, RUNNING) interface. If not found any +configured interface fall back to IP address of the machine hostname. .TP 6 or 6{interface} -Insert the IPv6 address of the machine hostname or IPv6 address the configured -network interface if the interface argument is specified (e.g. \\6{eth0}} +The same as \\4 but for IPv6. .TP b Insert the baudrate of the current line. -- cgit v1.2.3-55-g7522