1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-08 15:39:05 +00:00

Move non-config definitions to the file where they are used. Closes #1013

This commit is contained in:
dmiller
2017-09-19 17:01:38 +00:00
parent ce5bdd6762
commit 571cd2d903
2 changed files with 11 additions and 12 deletions

View File

@@ -309,15 +309,3 @@ char *strsep(char **, const char *);
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
/* Unix Network Programming, 3rd edition says that sockaddr structures in
rt_msghdr should be padded so their addresses start on a multiple of
sizeof(u_long). But on 64-bit Mac OS X 10.6 at least, this is false. Apple's
netstat code uses 4-byte padding, not 8-byte. This is relevant for IPv6
addresses, for which sa_len == 28.
http://www.opensource.apple.com/source/network_cmds/network_cmds-329.2.2/netstat.tproj/route.c */
#ifdef __APPLE__
#define RT_MSGHDR_ALIGNMENT sizeof(uint32_t)
#else
#define RT_MSGHDR_ALIGNMENT sizeof(unsigned long)
#endif

View File

@@ -52,6 +52,17 @@
http://fxr.watson.org/fxr/ident?v=NETBSD;i=RT_ROUNDUP */
#define ROUNDUP(a) RT_ROUNDUP(a)
#else
/* Unix Network Programming, 3rd edition says that sockaddr structures in
rt_msghdr should be padded so their addresses start on a multiple of
sizeof(u_long). But on 64-bit Mac OS X 10.6 at least, this is false. Apple's
netstat code uses 4-byte padding, not 8-byte. This is relevant for IPv6
addresses, for which sa_len == 28.
http://www.opensource.apple.com/source/network_cmds/network_cmds-329.2.2/netstat.tproj/route.c */
#ifdef __APPLE__
#define RT_MSGHDR_ALIGNMENT sizeof(uint32_t)
#else
#define RT_MSGHDR_ALIGNMENT sizeof(unsigned long)
#endif
#define ROUNDUP(a) \
((a) > 0 ? (1 + (((a) - 1) | (RT_MSGHDR_ALIGNMENT - 1))) : RT_MSGHDR_ALIGNMENT)
#endif