]> git.puffer.fish Git - matthieu/frr.git/commitdiff
solaris: more warnings fixed
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 16 Sep 2015 03:36:20 +0000 (20:36 -0700)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 15:33:32 +0000 (15:33 +0000)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit da1b7eaa0ac5d590818e1cde92a9807a2f0e07f2)

zebra/kernel_socket.c

index 4a1081865d9f88a929cee973b0a08bc37c8acd1d..495a4bb0702ec432c6b5fe9bb9b1d47ac53bab80 100644 (file)
@@ -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 */