aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2009-12-14 22:30:07 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2009-12-14 22:30:07 +0000
commit5f26dcd859a18811682d7705d4567ca379d89393 (patch)
treecb092fb1c718bf76743ea56abebd94cbdc0f527a
parent871d21ce2dbdf58e7dbd1c4dacb5861844cf02f6 (diff)
downloadsrc-5f26dcd859a18811682d7705d4567ca379d89393.tar.gz
src-5f26dcd859a18811682d7705d4567ca379d89393.zip
Don't report current link status if interface is not UP.
If interface is not UP, the current link status wouldn't reflect the negotiated status.
Notes
Notes: svn path=/head/; revision=200555
-rw-r--r--sys/dev/vge/if_vge.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c
index 39fdd5ac4c09..b5f3aaece52c 100644
--- a/sys/dev/vge/if_vge.c
+++ b/sys/dev/vge/if_vge.c
@@ -2177,6 +2177,10 @@ vge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
mii = device_get_softc(sc->vge_miibus);
VGE_LOCK(sc);
+ if ((ifp->if_flags & IFF_UP) == 0) {
+ VGE_UNLOCK(sc);
+ return;
+ }
mii_pollstat(mii);
VGE_UNLOCK(sc);
ifmr->ifm_active = mii->mii_media_active;