From: Rafael Zalamena Date: Thu, 17 Jan 2019 15:19:30 +0000 (-0200) Subject: zebra: remove unused functions X-Git-Tag: frr-7.1-dev~9^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b04f70c1b87dd2f11a7c07e18b3cabb68a8628ce;p=mirror%2Ffrr.git zebra: remove unused functions Remove two unused functions in `zebra/rt_socket.c`. Signed-off-by: Rafael Zalamena (cherry picked from commit 914fea09d9e1a5379b7ed9fa43b0505a091395af) --- diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c index b27171a00f..7dc5ef8b66 100644 --- a/zebra/rt_socket.c +++ b/zebra/rt_socket.c @@ -44,30 +44,6 @@ 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)