[Bug 197270] [Patch] Improve output of ifconfig command

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Feb 2 16:58:33 UTC 2015


--- Comment #8 from Hiroki Sato <hrs at FreeBSD.org> ---
(In reply to commit-hook from comment #4)

>  Reorganize the list of addresses associated with an interface and group them
>  based on the address family. This should help to recognize interfaces with
>  multiple AF (e.g. ipv4 and ipv6) with many aliases or additional addresses. The
>  order of addresses inside a single group is strictly preserved.
> Improve the scope_id output for AF_INET6 families, as the
>  current approach uses hexadecimal string that is basically the ID of an
>  interface, whilst this information is already depicted by getnameinfo(3) call.
>  Therefore, now ifconfig just prints the scope of address as it is defined in
>  2.4 of RFC 2373.

 Please revert the second half of this change.  Checking the address
 structure in userland in the manner of in6_print_scope() is redundant
 because almost the same check is already performed in the kernel when
 getifaddrs(3) is called.  If scope_id > 0, or IN6_IS_ADDR_LOOPBACK()
 is true, it is link-local.  Site-local is deprecated in RFC 3879 and
 new implementation MUST NOT support it.  Plus, using hard-coded
 values of address prefixes is inappropriate.  This kind of scope
 check should be performed by only
 IN6_IS_ADDR_{LINKLOCAL,SITELOCAL,...} macros if you want a strict
 one.  And I am not sure why "Multicast" is added here.  The multicast
 group membership list is returned by getifmaddrs(3), not

 Also, RFC 4007 specifies that at least non-negative decimal integer
 SHOULD be supported as scope zone id.  We support it.  However, if
 removing the scopeid part, it becomes difficult to know the zone id.
 This is the reason why scopeid is displayed along with %zone_id.
 A symbolic "%zone_id" itself means "it is non-global".
 Is "scope: link" still needed?

 Putting the above aside, I do not think it is a good idea to change
 the command line output because it breaks consistency
 (e.g. ifmcstat(8) also uses scopeid notation) and compatibility of
 scripts which depend on it, for example.  scopeid has lived for 10+
 years.  While adding "scope: link" or something may be acceptable,
 replacing scopeid with it does not look a good improvement, at least
 to me.

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list