diff options
author | Sergey Matveychuk <sem@FreeBSD.org> | 2008-07-02 16:22:57 +0000 |
---|---|---|
committer | Sergey Matveychuk <sem@FreeBSD.org> | 2008-07-02 16:22:57 +0000 |
commit | e03a4c47810fd98fdbde359fd2268525ea760f6a (patch) | |
tree | f0148ceab7290c7a855e64344462de8931391185 | |
parent | 87a1c3c10c0579fbb565fab0cd5043295704c16a (diff) |
Notes
-rw-r--r-- | net/quagga/Makefile | 2 | ||||
-rw-r--r-- | net/quagga/files/patch-cvs-1-zebra-ioctl.c | 47 |
2 files changed, 48 insertions, 1 deletions
diff --git a/net/quagga/Makefile b/net/quagga/Makefile index d2460436c988..fffd49501cfd 100644 --- a/net/quagga/Makefile +++ b/net/quagga/Makefile @@ -7,7 +7,7 @@ PORTNAME= quagga PORTVERSION= 0.99.10 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net ipv6 MASTER_SITES= http://quagga.net/download/ \ http://www.ru.quagga.net/download/ \ diff --git a/net/quagga/files/patch-cvs-1-zebra-ioctl.c b/net/quagga/files/patch-cvs-1-zebra-ioctl.c new file mode 100644 index 000000000000..e7985032a3ac --- /dev/null +++ b/net/quagga/files/patch-cvs-1-zebra-ioctl.c @@ -0,0 +1,47 @@ +--- zebra/ioctl.c 26 Feb 2008 14:02:24 -0000 1.15 ++++ zebra/ioctl.c 1 Jul 2008 15:43:04 -0000 +@@ -362,22 +362,29 @@ if_get_flags (struct interface *ifp) + return; + } + #ifdef HAVE_BSD_LINK_DETECT /* Detect BSD link-state at start-up */ +- (void) memset(&ifmr, 0, sizeof(ifmr)); +- strncpy (&ifmr.ifm_name, ifp->name, IFNAMSIZ); +- if (if_ioctl(SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) +- { +- zlog_err("if_ioctl(SIOCGIFMEDIA) failed: %s", safe_strerror(errno)); +- return; +- } +- if (ifmr.ifm_status & IFM_AVALID) /* Link state is valid */ ++ ++ /* Per-default, IFF_RUNNING is held high, unless link-detect says ++ * otherwise - we abuse IFF_RUNNING inside zebra as a link-state flag, ++ * following practice on Linux and Solaris kernels ++ */ ++ SET_FLAG(ifreq.ifr_flags, IFF_RUNNING); ++ ++ if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_LINKDETECTION)) + { +- if (ifmr.ifm_status & IFM_ACTIVE) +- SET_FLAG(ifreq.ifr_flags, IFF_RUNNING); +- else +- UNSET_FLAG(ifreq.ifr_flags, IFF_RUNNING); +- } +- else /* Force always up */ +- SET_FLAG(ifreq.ifr_flags, IFF_RUNNING); ++ (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); ++ } ++ } + #endif /* HAVE_BSD_LINK_DETECT */ + + if_flags_update (ifp, (ifreq.ifr_flags & 0x0000ffff)); |