aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndrew Thompson <thompsa@FreeBSD.org>2008-12-17 21:04:43 +0000
committerAndrew Thompson <thompsa@FreeBSD.org>2008-12-17 21:04:43 +0000
commitf812e06742ef1b8eb7490cfc9fc0bf9f3beea8bf (patch)
tree217ca523585f079f2515cfe3bc8f2d5fe12d0a7b /sys
parentbe07c180073ead08fa137dbfd4aa5906ee129fcf (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_lagg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index f3c414321c53..0ab96b370d0a 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1211,7 +1211,7 @@ lagg_linkstate(struct lagg_softc *sc)
{
struct lagg_port *lp;
int new_link = LINK_STATE_DOWN;
- uint64_t speed = 0;
+ uint64_t speed;
/* Our link is considered up if at least one of our ports is active */
SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
@@ -1225,12 +1225,13 @@ lagg_linkstate(struct lagg_softc *sc)
/* Update if_baudrate to reflect the max possible speed */
switch (sc->sc_proto) {
case LAGG_PROTO_FAILOVER:
- sc->sc_ifp->if_baudrate =
- sc->sc_primary->lp_ifp->if_baudrate;
+ sc->sc_ifp->if_baudrate = sc->sc_primary != NULL ?
+ sc->sc_primary->lp_ifp->if_baudrate : 0;
break;
case LAGG_PROTO_ROUNDROBIN:
case LAGG_PROTO_LOADBALANCE:
case LAGG_PROTO_ETHERCHANNEL:
+ speed = 0;
SLIST_FOREACH(lp, &sc->sc_ports, lp_entries)
speed += lp->lp_ifp->if_baudrate;
sc->sc_ifp->if_baudrate = speed;