From 5b73a671aac22a75cc90657aa4a924d199f2284b Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 23 Jul 2004 15:26:14 +0000 Subject: 2004-07-23 Sowmini Varadhan * if_ioctl_solaris.c: HAVE_IPV6 ifdef fixups * zserv.c: ditto * ioctl_solaris.c: ditto. * interface.c: cast for LLADDR * interface.h: Add guards, include redistribute.h and remove extraneous definitions of zebra_interface_{up,down}_update * ioctl.h: Add AF_IOCTL define for non SOLARIS_IPV6 * redistribute.h: include dependent header, zserv.h * zserv.h: include dependent header, rib.h --- zebra/if_ioctl_solaris.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'zebra/if_ioctl_solaris.c') diff --git a/zebra/if_ioctl_solaris.c b/zebra/if_ioctl_solaris.c index 9441abed..c05883c6 100644 --- a/zebra/if_ioctl_solaris.c +++ b/zebra/if_ioctl_solaris.c @@ -137,11 +137,22 @@ calculate_lifc_len: /* must hold privileges to enter here */ for (n = 0; n < lifconf.lifc_len; n += sizeof (struct lifreq)) { ifp = if_get_by_name (lifreq->lifr_name); + if (lifreq->lifr_addr.ss_family == AF_INET) ifp->flags |= IFF_IPV4; + if (lifreq->lifr_addr.ss_family == AF_INET6) - ifp->flags |= IFF_IPV6; + { +#ifdef HAVE_IPV6 + ifp->flags |= IFF_IPV6; +#else + lifreq++; + continue; +#endif /* HAVE_IPV6 */ + } + if_add_update (ifp); + interface_info_ioctl (ifp); if_get_addr (ifp, (struct sockaddr *) &lifreq->lifr_addr); lifreq++; @@ -265,7 +276,8 @@ if_get_addr (struct interface *ifp, struct sockaddr *addr) dest_pnt = (char *) &SIN (&dest)->sin_addr; } } - else +#ifdef HAVE_IPV6 + else if (af == AF_INET6) { if (ifp->flags & IFF_POINTOPOINT) { @@ -285,15 +297,17 @@ if_get_addr (struct interface *ifp, struct sockaddr *addr) } } } - +#endif /* HAVE_IPV6 */ /* Set address to the interface. */ if (af == AF_INET) connected_add_ipv4 (ifp, 0, &SIN (addr)->sin_addr, prefixlen, (struct in_addr *) dest_pnt, NULL); - else +#ifdef HAVE_IPV6 + else if (af == AF_INET6) connected_add_ipv6 (ifp, &SIN6 (addr)->sin6_addr, prefixlen, (struct in6_addr *) dest_pnt); +#endif /* HAVE_IPV6 */ return 0; } @@ -319,6 +333,7 @@ interface_list () struct connected * if_lookup_linklocal (struct interface *ifp) { +#ifdef HAVE_IPV6 listnode node; struct connected *ifc; @@ -333,5 +348,7 @@ if_lookup_linklocal (struct interface *ifp) (IN6_IS_ADDR_LINKLOCAL (&ifc->address->u.prefix6))) return ifc; } +#endif /* HAVE_IPV6 */ + return NULL; } -- cgit v1.2.3