summaryrefslogtreecommitdiff
path: root/zebra/kernel_socket.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2015-09-15 20:36:20 -0700
committerDaniel Walton <dwalton@cumulusnetworks.com>2016-05-26 15:33:32 +0000
commitfb4ca3e7c4d4fcae336eb9c60a42cad8f421410e (patch)
treee2fa1a2578be21ab84a60202ab7649e980477a64 /zebra/kernel_socket.c
parentf7f9a982fa16dd519b337b7407a76ec2ad5aca0c (diff)
solaris: more warnings fixed
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit da1b7eaa0ac5d590818e1cde92a9807a2f0e07f2)
Diffstat (limited to 'zebra/kernel_socket.c')
-rw-r--r--zebra/kernel_socket.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 4a1081865d..495a4bb070 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -139,6 +139,8 @@ extern struct zebra_privs_t zserv_privs;
static inline void
rta_copy (union sockunion *dest, caddr_t src) {
int len;
+ if (!dest)
+ return;
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
len = (((struct sockaddr *)src)->sa_len > sizeof (*dest)) ?
sizeof (*dest) : ((struct sockaddr *)src)->sa_len ;
@@ -153,8 +155,7 @@ rta_copy (union sockunion *dest, caddr_t src) {
if ((RTMADDRS) & (RTA)) \
{ \
int len = SAROUNDUP ((PNT)); \
- if ( ((DEST) != NULL) && \
- af_check (((struct sockaddr *)(PNT))->sa_family)) \
+ if (af_check (((struct sockaddr *)(PNT))->sa_family)) \
rta_copy((DEST), (PNT)); \
(PNT) += len; \
}
@@ -162,8 +163,7 @@ rta_copy (union sockunion *dest, caddr_t src) {
if ((RTMADDRS) & (RTA)) \
{ \
int len = SAROUNDUP ((PNT)); \
- if ((DEST) != NULL) \
- rta_copy((DEST), (PNT)); \
+ rta_copy((DEST), (PNT)); \
(PNT) += len; \
}
@@ -755,7 +755,9 @@ ifam_read (struct ifa_msghdr *ifam)
/* Unset interface index from link-local address when IPv6 stack
is KAME. */
if (IN6_IS_ADDR_LINKLOCAL (&addr.sin6.sin6_addr))
- SET_IN6_LINKLOCAL_IFINDEX (addr.sin6.sin6_addr, 0);
+ {
+ SET_IN6_LINKLOCAL_IFINDEX (addr.sin6.sin6_addr, 0);
+ }
if (ifam->ifam_type == RTM_NEWADDR)
connected_add_ipv6 (ifp, flags, &addr.sin6.sin6_addr,
@@ -1174,7 +1176,8 @@ rtmsg_debug (struct rt_msghdr *rtm)
zlog_debug ("Kernel: Len: %d Type: %s", rtm->rtm_msglen, lookup (rtm_type_str, rtm->rtm_type));
rtm_flag_dump (rtm->rtm_flags);
zlog_debug ("Kernel: message seq %d", rtm->rtm_seq);
- zlog_debug ("Kernel: pid %d, rtm_addrs 0x%x", rtm->rtm_pid, rtm->rtm_addrs);
+ zlog_debug ("Kernel: pid %lld, rtm_addrs 0x%x",
+ (long long)rtm->rtm_pid, rtm->rtm_addrs);
}
/* This is pretty gross, better suggestions welcome -- mhandler */