Lines 731-736
Link Here
|
731 |
if (CK_SLIST_EMPTY(&sc->sc_ports)) |
731 |
if (CK_SLIST_EMPTY(&sc->sc_ports)) |
732 |
sc->sc_primary = lp; |
732 |
sc->sc_primary = lp; |
733 |
|
733 |
|
|
|
734 |
LAGG_RLOCK(); |
734 |
/* Change the interface type */ |
735 |
/* Change the interface type */ |
735 |
lp->lp_iftype = ifp->if_type; |
736 |
lp->lp_iftype = ifp->if_type; |
736 |
ifp->if_type = IFT_IEEE8023ADLAG; |
737 |
ifp->if_type = IFT_IEEE8023ADLAG; |
Lines 751-757
Link Here
|
751 |
* is predictable and `ifconfig laggN create ...` command |
752 |
* is predictable and `ifconfig laggN create ...` command |
752 |
* will lead to the same result each time. |
753 |
* will lead to the same result each time. |
753 |
*/ |
754 |
*/ |
754 |
LAGG_RLOCK(); |
|
|
755 |
CK_SLIST_FOREACH(tlp, &sc->sc_ports, lp_entries) { |
755 |
CK_SLIST_FOREACH(tlp, &sc->sc_ports, lp_entries) { |
756 |
if (tlp->lp_ifp->if_index < ifp->if_index && ( |
756 |
if (tlp->lp_ifp->if_index < ifp->if_index && ( |
757 |
CK_SLIST_NEXT(tlp, lp_entries) == NULL || |
757 |
CK_SLIST_NEXT(tlp, lp_entries) == NULL || |
Lines 759-765
Link Here
|
759 |
ifp->if_index)) |
759 |
ifp->if_index)) |
760 |
break; |
760 |
break; |
761 |
} |
761 |
} |
762 |
LAGG_RUNLOCK(); |
|
|
763 |
if (tlp != NULL) |
762 |
if (tlp != NULL) |
764 |
CK_SLIST_INSERT_AFTER(tlp, lp, lp_entries); |
763 |
CK_SLIST_INSERT_AFTER(tlp, lp, lp_entries); |
765 |
else |
764 |
else |
Lines 774-783
Link Here
|
774 |
lagg_port_destroy(lp, 0); |
773 |
lagg_port_destroy(lp, 0); |
775 |
if (oldmtu != -1) |
774 |
if (oldmtu != -1) |
776 |
(*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); |
775 |
(*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); |
|
|
776 |
LAGG_RUNLOCK(); |
777 |
return (error); |
777 |
return (error); |
778 |
} |
778 |
} |
|
|
779 |
LAGG_RUNLOCK(); |
779 |
|
780 |
|
780 |
/* Update lagg capabilities */ |
781 |
/* Update lagg capabilities */ |
|
|
782 |
lagg_proto_linkstate(sc, lp); |
781 |
lagg_capabilities(sc); |
783 |
lagg_capabilities(sc); |
782 |
lagg_linkstate(sc); |
784 |
lagg_linkstate(sc); |
783 |
|
785 |
|
Lines 828-833
Link Here
|
828 |
|
830 |
|
829 |
LAGG_XLOCK_ASSERT(sc); |
831 |
LAGG_XLOCK_ASSERT(sc); |
830 |
|
832 |
|
|
|
833 |
LAGG_RLOCK(); |
831 |
if (rundelport) |
834 |
if (rundelport) |
832 |
lagg_proto_delport(sc, lp); |
835 |
lagg_proto_delport(sc, lp); |
833 |
|
836 |
|
Lines 850-855
Link Here
|
850 |
/* Finally, remove the port from the lagg */ |
853 |
/* Finally, remove the port from the lagg */ |
851 |
CK_SLIST_REMOVE(&sc->sc_ports, lp, lagg_port, lp_entries); |
854 |
CK_SLIST_REMOVE(&sc->sc_ports, lp, lagg_port, lp_entries); |
852 |
sc->sc_count--; |
855 |
sc->sc_count--; |
|
|
856 |
LAGG_RUNLOCK(); |
853 |
|
857 |
|
854 |
/* Update the primary interface */ |
858 |
/* Update the primary interface */ |
855 |
if (lp == sc->sc_primary) { |
859 |
if (lp == sc->sc_primary) { |