summaryrefslogtreecommitdiffstats
path: root/sys/net/if_lagg.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2008-09-18 04:14:28 +0000
committerthompsa <thompsa@FreeBSD.org>2008-09-18 04:14:28 +0000
commitee03ce0fd899a584671d0cc80fad715980980c32 (patch)
tree2877624adc0af6251ef550d935738c53e03dbcda /sys/net/if_lagg.c
parent97219c55ce56f2fca97d4b2c1d157ade3083c500 (diff)
downloadFreeBSD-src-ee03ce0fd899a584671d0cc80fad715980980c32.zip
FreeBSD-src-ee03ce0fd899a584671d0cc80fad715980980c32.tar.gz
Make sure there is at least one port to avoid divide by zero when choosing the
tx port. PR: kern/122794 MFC after: 3 days
Diffstat (limited to 'sys/net/if_lagg.c')
-rw-r--r--sys/net/if_lagg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index c7e1fa5..5d04282 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1123,7 +1123,8 @@ lagg_start(struct ifnet *ifp)
ETHER_BPF_MTAP(ifp, m);
- if (sc->sc_proto != LAGG_PROTO_NONE)
+ /* We need a Tx algorithm and at least one port */
+ if (sc->sc_proto != LAGG_PROTO_NONE && sc->sc_count)
error = (*sc->sc_start)(sc, m);
else
m_freem(m);
OpenPOWER on IntegriCloud