diff options
author | ae <ae@FreeBSD.org> | 2015-01-25 16:35:03 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2015-01-25 16:35:03 +0000 |
commit | efbb33d3cf761b71e78120f04ba76f3afae4da92 (patch) | |
tree | a6c6ce67face2542fd610395a5386f2a09ffdcac /sys/net/if_lagg.c | |
parent | e6f27f6344ffc1d62a7587928a496973be38bccb (diff) | |
download | FreeBSD-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.c | 9 |
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; } |