1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-27 18:09:01 +00:00
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
2012-09-08 16:22:23 +00:00
2012-09-08 19:44:24 +00:00
2012-08-02 18:35:36 +00:00
2012-09-08 19:44:24 +00:00
2012-08-13 19:53:38 +00:00
2012-03-07 03:15:51 +00:00
2012-09-08 19:44:24 +00:00
2012-05-27 08:53:32 +00:00
2012-03-07 17:59:55 +00:00
2012-08-28 08:20:31 +00:00
2012-08-28 07:50:09 +00:00
2012-08-03 23:46:06 +00:00
2012-08-28 13:07:19 +00:00
2012-08-28 13:07:19 +00:00
2012-05-27 08:53:32 +00:00
2008-07-31 14:18:21 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-08-04 16:05:24 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-08-28 07:50:30 +00:00
2012-03-19 16:48:27 +00:00
2012-08-14 16:36:25 +00:00
2012-08-14 16:36:25 +00:00
2012-05-05 18:02:34 +00:00

Here is some documentation for Nmap, but these files are much less
comprehensive than what you'll find at the actual Nmap documentation
site ( http://nmap.org ).
Languages
C 37.8%
Lua 28.1%
C++ 16.7%
Shell 5.8%
Python 4.2%
Other 7.2%