]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: remove unused functions
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Thu, 17 Jan 2019 15:19:30 +0000 (13:19 -0200)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 22 Jan 2019 11:33:38 +0000 (09:33 -0200)
Remove two unused functions in `zebra/rt_socket.c`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 914fea09d9e1a5379b7ed9fa43b0505a091395af)

zebra/rt_socket.c

index b27171a00f43d447a0241fc3a180875d3655a291..7dc5ef8b66efd8ce6a3a1061bc228a8a642fdf4c 100644 (file)
 
 extern struct zebra_privs_t zserv_privs;
 
-#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
-/* Adjust netmask socket length. Return value is a adjusted sin_len
-   value. */
-static int sin_masklen(struct in_addr mask)
-{
-       char *p, *lim;
-       int len;
-       struct sockaddr_in sin;
-
-       if (mask.s_addr == 0)
-               return sizeof(long);
-
-       sin.sin_addr = mask;
-       len = sizeof(struct sockaddr_in);
-
-       lim = (char *)&sin.sin_addr;
-       p = lim + sizeof(sin.sin_addr);
-
-       while (*--p == 0 && p >= lim)
-               len--;
-       return len;
-}
-#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
-
 #ifdef __OpenBSD__
 static int kernel_rtm_add_labels(struct mpls_label_stack *nh_label,
                                 struct sockaddr_mpls *smpls)
@@ -89,30 +65,6 @@ static int kernel_rtm_add_labels(struct mpls_label_stack *nh_label,
 }
 #endif
 
-#ifdef SIN6_LEN
-/* Calculate sin6_len value for netmask socket value. */
-static int sin6_masklen(struct in6_addr mask)
-{
-       struct sockaddr_in6 sin6;
-       char *p, *lim;
-       int len;
-
-       if (IN6_IS_ADDR_UNSPECIFIED(&mask))
-               return sizeof(long);
-
-       sin6.sin6_addr = mask;
-       len = sizeof(struct sockaddr_in6);
-
-       lim = (char *)&sin6.sin6_addr;
-       p = lim + sizeof(sin6.sin6_addr);
-
-       while (*--p == 0 && p >= lim)
-               len--;
-
-       return len;
-}
-#endif /* SIN6_LEN */
-
 /* Interface between zebra message and rtm message. */
 static int kernel_rtm(int cmd, const struct prefix *p,
                      const struct nexthop_group *ng, uint32_t metric)