Date: Sun, 25 Jan 2015 14:50:50 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r277703 - stable/9/sys/net Message-ID: <201501251450.t0PEooEB008653@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Sun Jan 25 14:50:49 2015 New Revision: 277703 URL: https://svnweb.freebsd.org/changeset/base/277703 Log: MFC r277295: Fix condition and really sort ports. Also add comment describing the intent of this code. Modified: stable/9/sys/net/if_lagg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Sun Jan 25 14:32:48 2015 (r277702) +++ stable/9/sys/net/if_lagg.c Sun Jan 25 14:50:49 2015 (r277703) @@ -624,11 +624,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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501251450.t0PEooEB008653>