Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: [netbsd-5] src
Module Name: src
Committed By: bouyer
Date: Sun May 3 13:17:52 UTC 2009
Modified Files:
src/lib/libc/net [netbsd-5]: getifaddrs.3 getifaddrs.c
src/sbin/ifconfig [netbsd-5]: af_link.c ifconfig.c util.c util.h
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.38.1 src/lib/libc/net/getifaddrs.3
cvs rdiff -u -r1.11 -r1.11.12.1 src/lib/libc/net/getifaddrs.c
cvs rdiff -u -r1.3 -r1.3.2.1 src/sbin/ifconfig/af_link.c
cvs rdiff -u -r1.213.2.1 -r1.213.2.2 src/sbin/ifconfig/ifconfig.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/sbin/ifconfig/util.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/sbin/ifconfig/util.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index