nmap/libdnet-stripped
david 0674925f73 Skip over entire ifreq struct in NEXTIFR.
On platforms supporting sa_len, NEXTIFR would skip over sa_len bytes
starting at the beginning of ifr_addr, and assume that was the end of
the struct. (The idea being that a large address such as a sockaddr_in6
could overflow the nominal struct boundary.) This logic was wrong when
there was something else in the union bigger than sa_len; we would
increment into somewhere in the middle of the same struct.

This exhibited itself on NetBSD, where struct ifreq has a
sockaddr_storage member in its internal union:
struct	ifreq {
	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
	union {
		struct	sockaddr ifru_addr;
		struct	sockaddr ifru_dstaddr;
		struct	sockaddr ifru_broadaddr;
		struct	sockaddr_storage ifru_space;

No, we skip over sa_len bytes, or to the nominal end of the struct,
whichever is larger.

Unix Network Programming gets this wrong too; in figure 17.8 they do
ptr += sizeof(ifr->ifr_name) + max(sizeof(struct sockaddr), ifr->ifr_addr.sa_len);
2012-09-10 01:17:28 +00:00
..
config Use getkerninfo to get routing information on AIX. 2011-09-21 07:31:34 +00:00
include Handle ARPHRD_VOID in addr_ston. 2012-07-21 07:35:41 +00:00
src Skip over entire ifreq struct in NEXTIFR. 2012-09-10 01:17:28 +00:00
acconfig.h Add semicolons to the socklen_t typedefs, thanks again to Michael 2010-01-14 06:04:17 +00:00
aclocal.m4 autoreconf with Autoconf 2.63, Automake 1.10.1, and libtool 2.2.6. 2009-08-06 22:00:34 +00:00
configure Check for <netinet/in6_var.h>. 2011-09-28 06:55:47 +00:00
configure.in Check for <netinet/in6_var.h>. 2011-09-28 06:55:47 +00:00
dnet-config.in
INSTALL
libdnet-stripped.vcxproj Remove the nonexistent include/config.h from the build configuration. 2011-07-20 07:16:05 +00:00
LICENSE
Makefile.am Don't use the removed directorie man, python, and test in Makefile.am. 2009-08-06 21:45:19 +00:00
Makefile.am.common
Makefile.in autoreconf with Autoconf 2.63, Automake 1.10.1, and libtool 2.2.6. 2009-08-06 22:00:34 +00:00
NMAP_MODIFICATIONS Skip over entire ifreq struct in NEXTIFR. 2012-09-10 01:17:28 +00:00
README
THANKS
TODO

libdnet
-------

libdnet provides a simplified, portable interface to several low-level
networking routines, including network address manipulation, kernel
arp(4) cache and route(4) table lookup and manipulation, network
firewalling, network interface lookup and manipulation, IP tunnelling,
and raw IP packet and Ethernet frame transmission.

WWW: http://libdnet.sourceforge.net/

$Id: README 578 2005-02-14 21:00:17Z dugsong $