summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-10-05 11:57:49 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-10-05 11:57:49 +0000
commit3649b613e3cbcb8fbe2b38bc9d275f892828c2f6 (patch)
tree1897cb9f2644463b532df37c9ba357768b6a34fd /sys
parenteb2ec4dcae23313cae864a55a7371081e216a8e5 (diff)
Always update published link state even if the internal link state doesn't
change. Prevents us from getting stuck in LINK_STATE_UNKNOWN. Fixes PR 5914. tested by deraadt@, sthen@ ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_em.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 85042fc2691..0012e3bdb13 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.190 2008/10/02 20:21:14 brad Exp $ */
+/* $OpenBSD: if_em.c,v 1.191 2008/10/05 11:57:48 kettenis Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -1407,6 +1407,8 @@ em_update_link_status(struct em_softc *sc)
sc->link_active = 1;
sc->smartspeed = 0;
ifp->if_baudrate = sc->link_speed * 1000000;
+ }
+ if (!LINK_STATE_IS_UP(ifp->if_link_state)) {
if (sc->link_duplex == FULL_DUPLEX)
ifp->if_link_state = LINK_STATE_FULL_DUPLEX;
else
@@ -1418,6 +1420,8 @@ em_update_link_status(struct em_softc *sc)
ifp->if_baudrate = sc->link_speed = 0;
sc->link_duplex = 0;
sc->link_active = 0;
+ }
+ if (ifp->if_link_state != LINK_STATE_DOWN) {
ifp->if_link_state = LINK_STATE_DOWN;
if_link_state_change(ifp);
}