yes) AC_DEFINE(USE_FSETOWNCTTY, 1, [Must we have a CTTY for fsetown?]) ;;
esac
+AC_CACHE_CHECK(if the OS misses to clear cached routes when more specific routes become available, ac_cv_os_routeupdates,
+[[case "$host" in
+ *-*-netbsd*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+ac_cv_os_routeupdates=$ans]])
+case "$ac_cv_os_routeupdates" in
+ yes) AC_DEFINE(OS_MISSES_SPECIFIC_ROUTE_UPDATES, 1, [need to recreate sockets on changed routing?]) ;;
+esac
+
ntp_warning='GRONK'
AC_MSG_CHECKING(if we'll use clock_settime or settimeofday or stime)
case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
/*
* refresh_interface
- * check to see if getsockname of the current socket still agrees
- * with the original binding address
- * if not - recreate sockets if possible
+ *
+ * some OSes have been observed to keep
+ * cached routes even when more specific routes
+ * become available.
+ * this can be mitigated by re-binding
+ * the socket.
*/
static int
refresh_interface(struct interface * interface)
{
+#ifdef OS_MISSES_SPECIFIC_ROUTE_UPDATES
if (interface->fd != INVALID_SOCKET)
{
close_and_delete_fd_from_list(interface->fd);
{
return 0; /* invalid sockets are not refreshable */
}
+#else /* !OS_MISSES_SPECIFIC_ROUTE_UPDATES */
+ return interface->fd != INVALID_SOCKET;
+#endif /* !OS_MISSES_SPECIFIC_ROUTE_UPDATES */
}
/*