summaryrefslogtreecommitdiffstats
path: root/sys/net/if_lagg.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2008-07-04 05:33:58 +0000
committerthompsa <thompsa@FreeBSD.org>2008-07-04 05:33:58 +0000
commit9e755c9ce5cc0574520587604537f2aa19cc0b7b (patch)
treee2941c8d48cb2efc957589cba85d66b75b1bbcbd /sys/net/if_lagg.c
parent64ea45c65b5c069f31e6b7baab2c9f4f61bba730 (diff)
downloadFreeBSD-src-9e755c9ce5cc0574520587604537f2aa19cc0b7b.zip
FreeBSD-src-9e755c9ce5cc0574520587604537f2aa19cc0b7b.tar.gz
port % count will never be greater than LAGG_MAX_PORTS so nuke the test.
Diffstat (limited to 'sys/net/if_lagg.c')
-rw-r--r--sys/net/if_lagg.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 5e5a115..c7e1fa5 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1581,14 +1581,10 @@ lagg_lb_start(struct lagg_softc *sc, struct mbuf *m)
struct lagg_lb *lb = (struct lagg_lb *)sc->sc_psc;
struct lagg_port *lp = NULL;
uint32_t p = 0;
- int idx;
p = lagg_hashmbuf(m, lb->lb_key);
- if ((idx = p % sc->sc_count) >= LAGG_MAX_PORTS) {
- m_freem(m);
- return (EINVAL);
- }
- lp = lb->lb_ports[idx];
+ p %= sc->sc_count;
+ lp = lb->lb_ports[p];
/*
* Check the port's link state. This will return the next active
OpenPOWER on IntegriCloud