diff options
Diffstat (limited to 'lib/sockopt.c')
| -rw-r--r-- | lib/sockopt.c | 51 |
1 files changed, 0 insertions, 51 deletions
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 <zebra.h> -#ifdef SUNOS_5 -#include <ifaddrs.h> -#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 /* |
