diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-05-28 01:14:16 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-05-28 01:14:16 +0000 |
commit | f3cd77e41486334a04b835661b504ca4b4cf799c (patch) | |
tree | 4b5ff942fb0002288b22d1aa3ef21d9bb25d6f07 /sys/net/if_trunk.c | |
parent | 8830b7cd2e6202dff196e5f3f462ab0b04598e34 (diff) |
check if the interface is active and UP. some, but not all, network
drivers report an active link state even if the interface is DOWN.
this should fix trunk with various ethernet devices.
ok brad@
Diffstat (limited to 'sys/net/if_trunk.c')
-rw-r--r-- | sys/net/if_trunk.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index b6957723b23..3723febfb03 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.c,v 1.28 2006/05/23 04:56:55 reyk Exp $ */ +/* $OpenBSD: if_trunk.c,v 1.29 2006/05/28 01:14:15 reyk Exp $ */ /* * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org> @@ -568,7 +568,7 @@ trunk_port2req(struct trunk_port *tp, struct trunk_reqport *rp) strlcpy(rp->rp_portname, tp->tp_if->if_xname, sizeof(rp->rp_portname)); rp->rp_prio = tp->tp_prio; rp->rp_flags = tp->tp_flags; - if (tp->tp_link_state != LINK_STATE_DOWN) + if (TRUNK_PORTACTIVE(tp)) rp->rp_flags |= TRUNK_PORT_ACTIVE; } @@ -1025,19 +1025,19 @@ trunk_link_active(struct trunk_softc *tr, struct trunk_port *tp) if (tp == NULL) goto search; - if (tp->tp_link_state != LINK_STATE_DOWN) { + if (TRUNK_PORTACTIVE(tp)) { rval = tp; goto found; } if ((tp_next = SLIST_NEXT(tp, tp_entries)) != NULL && - tp_next->tp_link_state != LINK_STATE_DOWN) { + TRUNK_PORTACTIVE(tp_next)) { rval = tp_next; goto found; } search: SLIST_FOREACH(tp_next, &tr->tr_ports, tp_entries) { - if (tp_next->tp_link_state != LINK_STATE_DOWN) { + if (TRUNK_PORTACTIVE(tp_next)) { rval = tp_next; goto found; } |