From 55edb0d446a272907715b0825ff008557174d34a Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 11 Jan 2008 15:57:13 +0000 Subject: [link-detect] Improve BSD support. 2008-01-11 Andrew J. Schorr * lib/zebra.h: Revert previous change, no need to include here. * zebra/ioctl.c: If HAVE_BSD_LINK_DETECT is defined, include (if_get_flags) Remove debug messages about BSD link state. * zebra/kernel_socket.c: (bsd_linkdetect_translate) If link state is unknown, we should set the IFF_RUNNING flag. --- zebra/ioctl.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'zebra/ioctl.c') diff --git a/zebra/ioctl.c b/zebra/ioctl.c index 4f99a6cd..7bb4da1f 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -33,6 +33,10 @@ #include "zebra/rt.h" #include "zebra/interface.h" +#ifdef HAVE_BSD_LINK_DETECT +#include +#endif /* HAVE_BSD_LINK_DETECT*/ + extern struct zebra_privs_t zserv_privs; /* clear and set interface name string */ @@ -367,24 +371,12 @@ if_get_flags (struct interface *ifp) if (ifmr.ifm_status & IFM_AVALID) /* Link state is valid */ { if (ifmr.ifm_status & IFM_ACTIVE) - { - SET_FLAG(ifreq.ifr_flags, IFF_RUNNING); - zlog_debug("%s: BSD link state to up at interface %s, ifindex %d", - __func__, ifp->name, ifp->ifindex); - } + SET_FLAG(ifreq.ifr_flags, IFF_RUNNING); else - { - UNSET_FLAG(ifreq.ifr_flags, IFF_RUNNING); - zlog_debug("%s: BSD link state to down at interface %s, ifindex %d", - __func__, ifp->name, ifp->ifindex); - } + UNSET_FLAG(ifreq.ifr_flags, IFF_RUNNING); } else /* Force always up */ - { - SET_FLAG(ifreq.ifr_flags, IFF_RUNNING); - zlog_debug("%s: BSD link state invalid, forced up at interface %s, ifindex %d", - __func__, ifp->name, ifp->ifindex); - } + SET_FLAG(ifreq.ifr_flags, IFF_RUNNING); #endif /* HAVE_BSD_LINK_DETECT */ if_flags_update (ifp, (ifreq.ifr_flags & 0x0000ffff)); -- cgit v1.2.1