Index: share/man/man4/lagg.4 =================================================================== --- share/man/man4/lagg.4 +++ share/man/man4/lagg.4 @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2017 +.Dd October 14, 2018 .Dt LAGG 4 .Os .Sh NAME @@ -137,6 +137,9 @@ .Pp The MTU of the first interface to be added is used as the lagg MTU. All additional interfaces are required to have exactly the same value. +When changing the MTU, all ports must be changed to the new MTU, first. +Care must be taken to avoid leaving interfaces with different MTU values +when changing the MTU of ports. .Pp The .Ic loadbalance Index: sys/net/if_lagg.c =================================================================== --- sys/net/if_lagg.c +++ sys/net/if_lagg.c @@ -915,11 +915,6 @@ VLAN_CAPABILITIES(sc->sc_ifp); break; - case SIOCSIFMTU: - /* Do not allow the MTU to be changed once joined */ - error = EINVAL; - break; - default: goto fallback; } @@ -1464,8 +1459,28 @@ break; case SIOCSIFMTU: - /* Do not allow the MTU to be directly changed */ - error = EINVAL; + if (ifr->ifr_mtu < 576) { + error = EINVAL; + break; + } + if (CK_SLIST_EMPTY(&sc->sc_ports)) { + sc->sc_ifp->if_mtu = ifr->ifr_mtu; + break; + } + LAGG_XLOCK(sc); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (lp->lp_ifp->if_mtu != ifr->ifr_mtu) { + if_printf(sc->sc_ifp, + "invalid MTU: %u(%s) != %d\n", + lp->lp_ifp->if_mtu, + lp->lp_ifp->if_xname, ifr->ifr_mtu); + error = EINVAL; + break; + } + } + if (!error) + sc->sc_ifp->if_mtu = ifr->ifr_mtu; + LAGG_XUNLOCK(sc); break; default: