This is done by heuristic in util-linux/term-utils/agetty.c:output_iface_ip() -> print_addr() -> inet_ntop(3) It needs to be improved for IPv6.