summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2012-09-26 19:24:07 +0000
committerBrad Smith <brad@cvs.openbsd.org>2012-09-26 19:24:07 +0000
commit1c96254e998950d7451302540f7410cde768f6bb (patch)
tree7b8f6c59b1315a1b8d95af9855404bd3c26d013b /sys/dev/pci
parent6d03a531eabd287e04b01a4fe246d01cb197b526 (diff)
Do not report link status unless the interface is up as the status is
only valid when the interface is up. From FreeBSD ok sthen@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_ale.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/if_ale.c b/sys/dev/pci/if_ale.c
index 1ede50cb6e8..1e5004eaf3e 100644
--- a/sys/dev/pci/if_ale.c
+++ b/sys/dev/pci/if_ale.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ale.c,v 1.23 2011/10/19 07:49:55 kevlo Exp $ */
+/* $OpenBSD: if_ale.c,v 1.24 2012/09/26 19:24:06 brad Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
@@ -243,6 +243,9 @@ ale_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
struct ale_softc *sc = ifp->if_softc;
struct mii_data *mii = &sc->sc_miibus;
+ if ((ifp->if_flags & IFF_UP) == 0)
+ return;
+
mii_pollstat(mii);
ifmr->ifm_status = mii->mii_media_status;
ifmr->ifm_active = mii->mii_media_active;