solaris: more warnings fixed
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 1622686..eded2bb 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -140,6 +140,8 @@
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 ;
@@ -154,8 +156,7 @@
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; \
}
@@ -163,8 +164,7 @@
if ((RTMADDRS) & (RTA)) \
{ \
int len = SAROUNDUP ((PNT)); \
- if ((DEST) != NULL) \
- rta_copy((DEST), (PNT)); \
+ rta_copy((DEST), (PNT)); \
(PNT) += len; \
}
@@ -738,7 +738,9 @@
/* 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,
@@ -1158,7 +1160,8 @@
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 */