diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2015-05-20 22:34:56 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2015-05-20 22:44:56 +0200 |
commit | ec38711852abdcaa0e7001e6a1e957052a0e723d (patch) | |
tree | c06db4d3a0d1020ce22d268e7128ee5a770ce7e5 /lib | |
parent | 9196caf16e30e938f4bc3c05d96f55195af7caff (diff) | |
download | quagga-ec38711852abdcaa0e7001e6a1e957052a0e723d.tar.bz2 quagga-ec38711852abdcaa0e7001e6a1e957052a0e723d.tar.xz |
lib: fix "sockunion: add hash function" for BSD (9196caf)
The sockunion_hash() function uses s6_addr32, which is not defined on
BSD systems. (It only works on glibc because we set _GNU_SOURCE)
ripngd/ripng_nexthop.h already contains a workaround for this. Bump
workaround to prefix.h so it's available everywhere.
Reported-by: NetDEF CI System <mwinter@netdef.org>
Fixes: 9196caf ("sockunion: add hash function")
Cc: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/prefix.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index 45889e08..a1a0679c 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -156,6 +156,16 @@ union prefix46constptr /* Prefix's family member. */ #define PREFIX_FAMILY(p) ((p)->family) +/* glibc defines s6_addr32 to __in6_u.__u6_addr32 if __USE_{MISC || GNU} */ +#ifndef s6_addr32 +#if defined(SUNOS_5) +/* Some SunOS define s6_addr32 only to kernel */ +#define s6_addr32 _S6_un._S6_u32 +#else +#define s6_addr32 __u6_addr.__u6_addr32 +#endif /* SUNOS_5 */ +#endif /*s6_addr32*/ + /* Prototypes. */ extern int afi2family (afi_t); extern afi_t family2afi (int); |