|
Lines 47-52
Link Here
|
| 47 |
|
47 |
|
| 48 |
#include "dnet.h" |
48 |
#include "dnet.h" |
| 49 |
|
49 |
|
|
|
50 |
/* Unix Network Programming, 3rd edition says that sockaddr structures in |
| 51 |
rt_msghdr should be padded so their addresses start on a multiple of |
| 52 |
sizeof(u_long). But on 64-bit Mac OS X 10.6 at least, this is false. Apple's |
| 53 |
netstat code uses 4-byte padding, not 8-byte. This is relevant for IPv6 |
| 54 |
addresses, for which sa_len == 28. |
| 55 |
http://www.opensource.apple.com/source/network_cmds/network_cmds-329.2.2/netstat.tproj/route.c */ |
| 56 |
#ifdef __APPLE__ |
| 57 |
#define RT_MSGHDR_ALIGNMENT sizeof(uint32_t) |
| 58 |
#else |
| 59 |
#define RT_MSGHDR_ALIGNMENT sizeof(unsigned long) |
| 60 |
#endif |
| 61 |
|
| 50 |
#if defined(RT_ROUNDUP) && defined(__NetBSD__) |
62 |
#if defined(RT_ROUNDUP) && defined(__NetBSD__) |
| 51 |
/* NetBSD defines this macro rounding to 64-bit boundaries. |
63 |
/* NetBSD defines this macro rounding to 64-bit boundaries. |
| 52 |
http://fxr.watson.org/fxr/ident?v=NETBSD;i=RT_ROUNDUP */ |
64 |
http://fxr.watson.org/fxr/ident?v=NETBSD;i=RT_ROUNDUP */ |