Mailing List Archive

[PATCH 8/8] Link detect does not work at startup at FreeBSD.
From: Ingo Flaschberger <if@xip.at>

Link-detect checks ZEBRA_INTERFACE_LINKDETECTION, which is not yet loaded at startup.
---
zebra/ioctl.c | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/zebra/ioctl.c b/zebra/ioctl.c
index d783b0a..6123efb 100644
--- a/zebra/ioctl.c
+++ b/zebra/ioctl.c
@@ -369,22 +369,19 @@ if_get_flags (struct interface *ifp)
*/
SET_FLAG(ifreq.ifr_flags, IFF_RUNNING);

- if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_LINKDETECTION))
- {
- (void) memset(&ifmr, 0, sizeof(ifmr));
- strncpy (ifmr.ifm_name, ifp->name, IFNAMSIZ);
+ (void) memset(&ifmr, 0, sizeof(ifmr));
+ strncpy (ifmr.ifm_name, ifp->name, IFNAMSIZ);

- /* Seems not all interfaces implement this ioctl */
- if (if_ioctl(SIOCGIFMEDIA, (caddr_t) &ifmr) < 0)
- zlog_err("if_ioctl(SIOCGIFMEDIA) failed: %s", safe_strerror(errno));
- else if (ifmr.ifm_status & IFM_AVALID) /* Link state is valid */
- {
- if (ifmr.ifm_status & IFM_ACTIVE)
- SET_FLAG(ifreq.ifr_flags, IFF_RUNNING);
- else
- UNSET_FLAG(ifreq.ifr_flags, IFF_RUNNING);
- }
- }
+ /* Seems not all interfaces implement this ioctl */
+ if (if_ioctl(SIOCGIFMEDIA, (caddr_t) &ifmr) < 0)
+ zlog_err("if_ioctl(SIOCGIFMEDIA) failed: %s", safe_strerror(errno));
+ else if (ifmr.ifm_status & IFM_AVALID) /* Link state is valid */
+ {
+ if (ifmr.ifm_status & IFM_ACTIVE)
+ SET_FLAG(ifreq.ifr_flags, IFF_RUNNING);
+ else
+ UNSET_FLAG(ifreq.ifr_flags, IFF_RUNNING);
+ }
#endif /* HAVE_BSD_LINK_DETECT */

if_flags_update (ifp, (ifreq.ifr_flags & 0x0000ffff));
--
1.7.1.1

_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
http://lists.quagga.net/mailman/listinfo/quagga-dev