diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2015-04-23 13:31:17 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2015-04-23 13:36:08 +0200 |
commit | dc684eb9976f8a1170312be42d142effce26b568 (patch) | |
tree | 1d1354118bc0b063e7048c86154339aa2f141d1c /zebra/kernel_socket.c | |
parent | 06bd420d4646333bc7ed9964e348f19a942fcfe2 (diff) | |
parent | e691c3bb972c0baf610d9e210ce20ea6546e1de0 (diff) | |
download | quagga-dc684eb9976f8a1170312be42d142effce26b568.tar.bz2 quagga-dc684eb9976f8a1170312be42d142effce26b568.tar.xz |
Merge branch 'volatile/fix_warnings'
Thanks to Donald Sharp and Greg Troxel for providing feedback!
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/kernel_socket.c')
-rw-r--r-- | zebra/kernel_socket.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 75534916..916dad97 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -58,6 +58,12 @@ extern struct zebra_t zebrad; * Because of these varying conventions, the only sane approach is for * the <net/route.h> header to define some flavor of ROUNDUP macro. */ + +#if defined(SA_SIZE) +/* SAROUNDUP is the only thing we need, and SA_SIZE provides that */ +#define SAROUNDUP(a) SA_SIZE(a) +#else /* !SA_SIZE */ + #if defined(RT_ROUNDUP) #define ROUNDUP(a) RT_ROUNDUP(a) #endif /* defined(RT_ROUNDUP) */ @@ -114,6 +120,8 @@ extern struct zebra_t zebrad; ROUNDUP(sizeof(struct sockaddr_dl)) : sizeof(struct sockaddr))) #endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */ +#endif /* !SA_SIZE */ + /* * We use a call to an inline function to copy (PNT) to (DEST) * 1. Calculating the length of the copy requires an #ifdef to determine @@ -121,7 +129,7 @@ extern struct zebra_t zebrad; * 2. So the compiler doesn't complain when DEST is NULL, which is only true * when we are skipping the copy and incrementing to the next SA */ -static void inline +static inline void rta_copy (union sockunion *dest, caddr_t src) { int len; #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN @@ -271,7 +279,7 @@ int routing_sock = -1; /* #define DEBUG */ /* Supported address family check. */ -static int inline +static inline int af_check (int family) { if (family == AF_INET) @@ -1114,15 +1122,6 @@ rtm_write (int message, msg.rtm.rtm_flags |= RTF_REJECT; -#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN -#define SOCKADDRSET(X,R) \ - if (msg.rtm.rtm_addrs & (R)) \ - { \ - int len = ROUNDUP ((X)->sa.sa_len); \ - memcpy (pnt, (caddr_t)(X), len); \ - pnt += len; \ - } -#else #define SOCKADDRSET(X,R) \ if (msg.rtm.rtm_addrs & (R)) \ { \ @@ -1130,7 +1129,6 @@ rtm_write (int message, memcpy (pnt, (caddr_t)(X), len); \ pnt += len; \ } -#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ pnt = (caddr_t) msg.buf; |