From 9823ded7ab5c3ba2650274738763521e3e277666 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sun, 19 Apr 2020 05:33:53 +0100 Subject: [PATCH] BSD: Dont warn if the kernel does not support flushing routers As the implemention might be removed one day. --- src/if-bsd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/if-bsd.c b/src/if-bsd.c index ee84f3ee..7361669a 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -1946,7 +1946,7 @@ if_setup_inet6(const struct interface *ifp) logerr("%s: set_ifxflags", ifp->name); #endif -#if defined(IPV6CTL_ACCEPT_RTADV) || defined(ND6_IFF_ACCEPT_RTADV) +#ifdef SIOCSRTRFLUSH_IN6 /* Flush the kernel knowledge of advertised routers * and prefixes so the kernel does not expire prefixes * and default routes we are trying to own. */ @@ -1957,12 +1957,14 @@ if_setup_inet6(const struct interface *ifp) strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); if (if_ioctl6(ifp->ctx, SIOCSRTRFLUSH_IN6, &ifr, sizeof(ifr)) == -1 && - errno != ENOTSUP) - logwarn("SIOCSRTRFLUSH_IN6"); + errno != ENOTSUP && errno != ENOTTY) + logwarn("SIOCSRTRFLUSH_IN6 %d", errno); +#ifdef SIOCSPFXFLUSH_IN6 if (if_ioctl6(ifp->ctx, SIOCSPFXFLUSH_IN6, &ifr, sizeof(ifr)) == -1 && - errno != ENOTSUP) + errno != ENOTSUP && errno != ENOTTY) logwarn("SIOCSPFXFLUSH_IN6"); +#endif } #endif } -- 2.47.2