svn commit: r277707 - stable/10/sys/net
Andrey V. Elsukov
ae at FreeBSD.org
Sun Jan 25 16:35:04 UTC 2015
Author: ae
Date: Sun Jan 25 16:35:03 2015
New Revision: 277707
URL: https://svnweb.freebsd.org/changeset/base/277707
Log:
MFC r277295:
Fix condition and really sort ports. Also add comment describing
the intent of this code.
Modified:
stable/10/sys/net/if_lagg.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/net/if_lagg.c
==============================================================================
--- stable/10/sys/net/if_lagg.c Sun Jan 25 15:44:46 2015 (r277706)
+++ stable/10/sys/net/if_lagg.c Sun Jan 25 16:35:03 2015 (r277707)
@@ -666,11 +666,16 @@ lagg_port_create(struct lagg_softc *sc,
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;
}
More information about the svn-src-all
mailing list