summaryrefslogtreecommitdiffstats
path: root/sys/net/if_lagg.c
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2015-01-25 16:35:03 +0000
committerae <ae@FreeBSD.org>2015-01-25 16:35:03 +0000
commitefbb33d3cf761b71e78120f04ba76f3afae4da92 (patch)
treea6c6ce67face2542fd610395a5386f2a09ffdcac /sys/net/if_lagg.c
parente6f27f6344ffc1d62a7587928a496973be38bccb (diff)
downloadFreeBSD-src-efbb33d3cf761b71e78120f04ba76f3afae4da92.zip
FreeBSD-src-efbb33d3cf761b71e78120f04ba76f3afae4da92.tar.gz
MFC r277295:
Fix condition and really sort ports. Also add comment describing the intent of this code.
Diffstat (limited to 'sys/net/if_lagg.c')
-rw-r--r--sys/net/if_lagg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 7218e29..f2973f6 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -666,11 +666,16 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
lagg_port_lladdr(lp, IF_LLADDR(sc->sc_ifp));
}
- /* Insert into the list of ports. Keep ports sorted by if_index. */
+ /*
+ * Insert into the list of ports.
+ * Keep ports sorted by if_index. It is handy, when configuration
+ * is predictable and `ifconfig laggN create ...` command
+ * will lead to the same result each time.
+ */
SLIST_FOREACH(tlp, &sc->sc_ports, lp_entries) {
if (tlp->lp_ifp->if_index < ifp->if_index && (
SLIST_NEXT(tlp, lp_entries) == NULL ||
- SLIST_NEXT(tlp, lp_entries)->lp_ifp->if_index <
+ SLIST_NEXT(tlp, lp_entries)->lp_ifp->if_index >
ifp->if_index))
break;
}
OpenPOWER on IntegriCloud