From cae8bc967cf7c93b7924ae4aaa05a99dfe345c78 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 8 Sep 2020 23:59:18 -0400 Subject: *: Remove solaris from FRR The Solaris code has gone through a deprecation cycle. No-one has said anything to us and worse of all we don't have any test systems running Solaris to know if we are making changes that are breaking on Solaris. Remove it from the system so we can clean up a bit. Signed-off-by: Donald Sharp --- lib/sockopt.c | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'lib/sockopt.c') diff --git a/lib/sockopt.c b/lib/sockopt.c index 21fddcd01d..ed21b72df7 100644 --- a/lib/sockopt.c +++ b/lib/sockopt.c @@ -20,10 +20,6 @@ #include -#ifdef SUNOS_5 -#include -#endif - #include "log.h" #include "sockopt.h" #include "sockunion.h" @@ -351,35 +347,6 @@ int setsockopt_ipv4_multicast_if(int sock, struct in_addr if_addr, return setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, (void *)&m, sizeof(m)); -#elif defined(SUNOS_5) - char ifname[IF_NAMESIZE]; - struct ifaddrs *ifa, *ifap; - struct in_addr ifaddr; - - if (if_indextoname(ifindex, ifname) == NULL) - return -1; - - if (getifaddrs(&ifa) != 0) - return -1; - - for (ifap = ifa; ifap != NULL; ifap = ifap->ifa_next) { - struct sockaddr_in *sa; - - if (strcmp(ifap->ifa_name, ifname) != 0) - continue; - if (ifap->ifa_addr->sa_family != AF_INET) - continue; - sa = (struct sockaddr_in *)ifap->ifa_addr; - memcpy(&ifaddr, &sa->sin_addr, sizeof(ifaddr)); - break; - } - - freeifaddrs(ifa); - if (!ifap) /* This means we did not find an IP */ - return -1; - - return setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, (void *)&ifaddr, - sizeof(ifaddr)); #else #error "Unsupported multicast API" #endif @@ -483,15 +450,9 @@ static ifindex_t getsockopt_ipv4_ifindex(struct msghdr *msgh) /* retrieval based on IP_RECVIF */ -#ifndef SUNOS_5 /* BSD systems use a sockaddr_dl as the control message payload. */ struct sockaddr_dl *sdl; -#else - /* SUNOS_5 uses an integer with the index. */ - ifindex_t *ifindex_p; -#endif /* SUNOS_5 */ -#ifndef SUNOS_5 /* BSD */ sdl = (struct sockaddr_dl *)getsockopt_cmsg_data(msgh, IPPROTO_IP, IP_RECVIF); @@ -499,18 +460,6 @@ static ifindex_t getsockopt_ipv4_ifindex(struct msghdr *msgh) ifindex = sdl->sdl_index; else ifindex = 0; -#else - /* - * Solaris. On Solaris 8, IP_RECVIF is defined, but the call to - * enable it fails with errno=99, and the struct msghdr has - * controllen 0. - */ - ifindex_p = (uint_t *)getsockopt_cmsg_data(msgh, IPPROTO_IP, IP_RECVIF); - if (ifindex_p != NULL) - ifindex = *ifindex_p; - else - ifindex = 0; -#endif /* SUNOS_5 */ #else /* -- cgit v1.2.3