QUAGGA_INCLUDES)],
[], QUAGGA_INCLUDES )
+dnl ---------------------------------------------------------------
+dnl Additional, newer way to check link-state using ifi_link_state.
+dnl Not available in all BSD's when ifmediareq available
+dnl ---------------------------------------------------------------
+AC_CHECK_HEADER([net/if.h],
+ AC_CHECK_MEMBERS([struct if_data.ifi_link_state],
+ AC_DEFINE(HAVE_BSD_IFI_LINK_STATE,,[BSD ifi_link_state available]),
+ [], QUAGGA_INCLUDES),
+ ,)
+
dnl ------------------------
dnl TCP_MD5SIG socket option
dnl ------------------------
}
#endif /* RTM_IFANNOUNCE */
-#ifdef HAVE_BSD_LINK_DETECT
+#ifdef HAVE_BSD_IFI_LINK_STATE
/* BSD link detect translation */
static void
bsd_linkdetect_translate (struct if_msghdr *ifm)
else
UNSET_FLAG(ifm->ifm_flags, IFF_RUNNING);
}
-#endif /* HAVE_BSD_LINK_DETECT */
+#endif /* HAVE_BSD_IFI_LINK_STATE */
/*
* Handle struct if_msghdr obtained from reading routing socket or
*/
ifp->ifindex = ifm->ifm_index;
-#ifdef HAVE_BSD_LINK_DETECT /* translate BSD kernel msg for link-state */
+#ifdef HAVE_BSD_IFI_LINK_STATE /* translate BSD kernel msg for link-state */
bsd_linkdetect_translate(ifm);
-#endif /* HAVE_BSD_LINK_DETECT */
+#endif /* HAVE_BSD_IFI_LINK_STATE */
if_flags_update (ifp, ifm->ifm_flags);
#if defined(__bsdi__)
return -1;
}
-#ifdef HAVE_BSD_LINK_DETECT /* translate BSD kernel msg for link-state */
+#ifdef HAVE_BSD_IFI_LINK_STATE /* translate BSD kernel msg for link-state */
bsd_linkdetect_translate(ifm);
-#endif /* HAVE_BSD_LINK_DETECT */
+#endif /* HAVE_BSD_IFI_LINK_STATE */
/* update flags and handle operative->inoperative transition, if any */
if_flags_update (ifp, ifm->ifm_flags);