aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 45315b6b3b55..a6e5b3c65a1f 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -799,11 +799,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;
}