diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-10-28 07:14:46 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-10-28 07:14:46 +0000 |
commit | 5faf0fc9d26bda999c250b4b6faaee97f2829e87 (patch) | |
tree | 0f1080d1d9fdaf349b51613c4589db5a21be3aa1 | |
parent | cb1dc98512bdfc68a7febd63dba562f846969d21 (diff) |
In trunk_media_status() mark the interface as active if any ports are
active rather than just the primary being UP.
From FreeBSD
Ok mpf@
-rw-r--r-- | sys/net/if_trunk.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index 467c6ebcdf3..ba45d355c11 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.c,v 1.54 2008/10/28 07:13:01 brad Exp $ */ +/* $OpenBSD: if_trunk.c,v 1.55 2008/10/28 07:14:45 brad Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org> @@ -1150,9 +1150,10 @@ trunk_media_status(struct ifnet *ifp, struct ifmediareq *imr) imr->ifm_status = IFM_AVALID; imr->ifm_active = IFM_ETHER | IFM_AUTO; - tp = tr->tr_primary; - if (tp != NULL && tp->tp_if->if_flags & IFF_UP) - imr->ifm_status |= IFM_ACTIVE; + SLIST_FOREACH(tp, &tr->tr_ports, tp_entries) { + if (TRUNK_PORTACTIVE(tp)) + imr->ifm_status |= IFM_ACTIVE; + } } void |