From: Roy Marples Date: Sun, 19 Apr 2020 04:33:53 +0000 (+0100) Subject: BSD: Dont warn if the kernel does not support flushing routers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a6f4ea264ff15bfa37422024a6b74d5c9a6ab13;p=thirdparty%2Fdhcpcd.git BSD: Dont warn if the kernel does not support flushing routers As the implemention might be removed one day. --- 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 }