Previously the bridge MTU was set to ETHERMTU and could not be changed. Since
we can only bridge interfaces with the same value it meant that all members had to be set at ETHERMTU as well. Allow the first member to be added to define the MTU for the bridge, the check still applies to all additional members. Print an informative message if the MTU is incorrect [1] Requested by: Niki Denev [1] Approved by: mlaier (mentor) MFC after: 3 days
This commit is contained in:
parent
ac5ee935dd
commit
489fc2258f
@ -133,6 +133,9 @@ the filter for processing.
|
||||
Note that packets to and from the bridging host will be seen by the
|
||||
filter on the interface with the appropriate address configured as well
|
||||
as on the interface on which the packet arrives or departs.
|
||||
.Pp
|
||||
The MTU of the first member interface to be added is used as the bridge MTU,
|
||||
all additional members are required to have exactly the same value.
|
||||
.Sh EXAMPLES
|
||||
The following when placed in the file
|
||||
.Pa /etc/rc.conf
|
||||
|
@ -716,8 +716,13 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg)
|
||||
if (ifs == NULL)
|
||||
return (ENOENT);
|
||||
|
||||
if (sc->sc_ifp->if_mtu != ifs->if_mtu)
|
||||
/* Allow the first member to define the MTU */
|
||||
if (LIST_EMPTY(&sc->sc_iflist))
|
||||
sc->sc_ifp->if_mtu = ifs->if_mtu;
|
||||
else if (sc->sc_ifp->if_mtu != ifs->if_mtu) {
|
||||
if_printf(sc->sc_ifp, "invalid MTU for %s\n", ifs->if_xname);
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
if (ifs->if_bridge == sc)
|
||||
return (EEXIST);
|
||||
|
Loading…
Reference in New Issue
Block a user