From 1c96254e998950d7451302540f7410cde768f6bb Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Wed, 26 Sep 2012 19:24:07 +0000 Subject: 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@ --- sys/dev/pci/if_ale.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/dev/pci') 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 * 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; -- cgit v1.2.3