The current \4 and \6 issue file escapes implementation is inferior. It
uses get getifaddrs() to get a list of IP addresses. This function does not
provide enough information to discriminate between stable IP addresses and
ephemeral addresses. As a result, especially \6 often gives unreliable
results.
The code is actually unable to get list of all interfaces, so a proper out
of the box IP address reporting depends on external tools that generate
issue file with the interfaces list.
The netlink messages are already used, but only as a change notifier. The
contents is not used, even if it contains exact information about the
change. As a result, change processing is triggered even for unrelated
network changes like IPv6 router advertisement.
The new implementation uses the new netaddrq library. It reports more
reliable results especially for IPv6.
Additionally, two new escapes are implemented:
\a Report all interfaces and assigned addresses that are considered as
reliable.
\A Report all interfaces and all assigned addresses.
TODO:
To prevent overflooding of the console, the list is currently limited to 12
interfaces. It would be nice to make it configurable.
Two pass processing of issue files. First pass just collects IP protocols
and list of interfaces (in future interface patterns). Now it always
processes both IPv4 and IPv6 on all interfaces. Not so bad, as \a is smart
enough to display just the useful part.
Maybe implement more options and formatting support for \a and \A.
Maybe implement interface filter globs or regexps for \a and \A. Still not
so bad, as \a automatically skips interfaces without reliable addresses
(e. g. lo or TUN).