Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (2h)  netbsd-10 (18d)  netbsd-9 (18d)  netbsd-8 (23d) 

2024-06-03 21:18:22 UTC Now

2009-05-03 13:17:52 UTC netbsd-5 commitmail json YAML

Pull up following revision(s) (requested by dyoung in ticket #730):
sbin/ifconfig/af_link.c: revisions 1.4 - 1.6
sbin/ifconfig/util.h: revision 1.7
sbin/ifconfig/util.c: revisions 1.10, 1.11
lib/libc/net/getifaddrs.c: revision 1.12
lib/libc/net/getifaddrs.3: revision 1.10
sbin/ifconfig/ifconfig.c: revisions 1.216 - 1.218
Fix indentation: change spaces to tabs.
Use getnameinfo(3) to render a human-readable link-layer address in the
'address: ' line, just as we do in the 'link xx:xx:...:xx' line.
There's no use casting a socket address to sockaddr_dl, only to cast it
back to sockaddr, so don't do it.
Cosmetic: add some whitespace for my ease of reading.
To make sure that we always print the active link-layer address in the
'address: ' field, don't treat the first address as the active address,
but search the link-layer addresses for the ones flagged IFLR_ACTIVE,
and print those.  Extract a subroutine, print_link_addresses(), for
printing link-layer addresses.
For non-AF_LINK ifaddrs, ifa_data is NULL.  AFAICT, this has always been
so.  Say so in the documentation.
Bring getifaddrs(3) behavior in line with the documentation: the
ifa_data member of every AF_LINK struct ifaddrs points at the
corresponding struct if_data.  In ifconfig(8), do not try to suppress
duplicate AF_LINK ifaddrs by checking for a NULL ifa_data.
Don't copy out two AF_LINK struct ifaddrs for each active link-layer
address. getifaddrs(3) used to copy out one ifaddrs for the kernel's
RTM_IFINFO message, and one more for the kernel's RTM_NEWADDR message.
I suppress the first duplicate with a highly conservative change that
wastes a little bit of ifaddrs storage.  The storage is not leaked.

(bouyer)