]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra/rt_socket: Fix warnings
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 16 Sep 2015 04:55:38 +0000 (21:55 -0700)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 15:33:33 +0000 (15:33 +0000)
Fix warning about unused sin_masklen / sin6_masklen

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 8fa1d027f23115dcb1c38b09c6e46edf5b8f7238)

zebra/rt_socket.c

index ca2ddc1fc65f7569794ca1b92396ca4c9b66134a..ee1c696fb62adaf750531845a6c836da1ed427e7 100644 (file)
@@ -41,6 +41,7 @@ extern int rtm_write (int message, union sockunion *dest,
                       union sockunion *mask, union sockunion *gate,
                       unsigned int index, int zebra_flags, int metric);
 
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
 /* Adjust netmask socket length. Return value is a adjusted sin_len
    value. */
 static int
@@ -63,6 +64,7 @@ sin_masklen (struct in_addr mask)
     len--;
   return len;
 }
+#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
 
 /* Interface between zebra message and rtm message. */
 static int
@@ -252,6 +254,7 @@ kernel_delete_ipv4 (struct prefix *p, struct rib *rib)
 
 #ifdef HAVE_IPV6
 
+#ifdef SIN6_LEN
 /* Calculate sin6_len value for netmask socket value. */
 static int
 sin6_masklen (struct in6_addr mask)
@@ -279,6 +282,7 @@ sin6_masklen (struct in6_addr mask)
 
   return len;
 }
+#endif /* SIN6_LEN */
 
 /* Interface between zebra message and rtm message. */
 static int
@@ -439,6 +443,8 @@ kernel_rtm_ipv6_multipath (int cmd, struct prefix *p, struct rib *rib,
          zlog_info ("kernel_rtm_ipv6_multipath(): nexthop %d add error=%d.",
            nexthop_num, error);
        }
+#else
+      (void)error;
 #endif
 
       nexthop_num++;