changeset 5152:352c272ba3c3 draft

BSD: Dont warn if the kernel does not support flushing routers As the implemention might be removed one day.
author Roy Marples <roy@marples.name>
date Sun, 19 Apr 2020 05:33:53 +0100
parents 3c6da4e11150
children 8248b3a04908
files src/if-bsd.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/if-bsd.c	Fri Apr 17 13:25:33 2020 +0100
+++ b/src/if-bsd.c	Sun Apr 19 05:33:53 2020 +0100
@@ -1946,7 +1946,7 @@
 		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 @@
 		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
 }