From 8aa416a6f3823ad1b5d5e778980f34b1f80db4ef Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Wed, 13 Dec 2017 16:50:16 +0100 Subject: [PATCH] zebra: remove useless iotcl linux calls As netlink is available for all linux systems ( old linux distributions are not considered), this commit removes the ipv6 ioctl support for linux. Signed-off-by: Philippe Guibert --- zebra/ioctl.c | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/zebra/ioctl.c b/zebra/ioctl.c index b5ed3ede97..8e3a1d1a03 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -467,46 +467,14 @@ int if_prefix_add_ipv6(struct interface *ifp, struct connected *ifc) { #ifdef HAVE_NETLINK return kernel_address_add_ipv6 (ifp, ifc); -#else /* ! HAVE_NETLINK */ - int ret; - struct prefix_ipv6 *p; - struct in6_ifreq ifreq; - - p = (struct prefix_ipv6 *)ifc->address; - - memset(&ifreq, 0, sizeof(struct in6_ifreq)); - - memcpy(&ifreq.ifr6_addr, &p->prefix, sizeof(struct in6_addr)); - ifreq.ifr6_ifindex = ifp->ifindex; - ifreq.ifr6_prefixlen = p->prefixlen; - - ret = if_ioctl_ipv6(SIOCSIFADDR, (caddr_t)&ifreq); - - return ret; -#endif /* ! HAVE_NETLINK */ +#endif /* HAVE_NETLINK */ } int if_prefix_delete_ipv6(struct interface *ifp, struct connected *ifc) { #ifdef HAVE_NETLINK return kernel_address_delete_ipv6 (ifp, ifc); -#else /* ! HAVE_NETLINK */ - int ret; - struct prefix_ipv6 *p; - struct in6_ifreq ifreq; - - p = (struct prefix_ipv6 *)ifc->address; - - memset(&ifreq, 0, sizeof(struct in6_ifreq)); - - memcpy(&ifreq.ifr6_addr, &p->prefix, sizeof(struct in6_addr)); - ifreq.ifr6_ifindex = ifp->ifindex; - ifreq.ifr6_prefixlen = p->prefixlen; - - ret = if_ioctl_ipv6(SIOCDIFADDR, (caddr_t)&ifreq); - - return ret; -#endif /* ! HAVE_NETLINK */ +#endif /* HAVE_NETLINK */ } #else /* LINUX_IPV6 */ #ifdef HAVE_STRUCT_IN6_ALIASREQ -- 2.39.5