summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2005-07-13 20:40:19 +0000
committerthompsa <thompsa@FreeBSD.org>2005-07-13 20:40:19 +0000
commita3d1367c6dd545dbf681fbb415d72be59f266ee2 (patch)
tree0fec5b4fa71849b464e1d5dae423db4390033637
parent8ca187d62004899e49fbffa7a4f51ead332ff7f6 (diff)
downloadFreeBSD-src-a3d1367c6dd545dbf681fbb415d72be59f266ee2.zip
FreeBSD-src-a3d1367c6dd545dbf681fbb415d72be59f266ee2.tar.gz
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
-rw-r--r--share/man/man4/if_bridge.43
-rw-r--r--sys/net/if_bridge.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/share/man/man4/if_bridge.4 b/share/man/man4/if_bridge.4
index 0a927e5..0a8c624 100644
--- a/share/man/man4/if_bridge.4
+++ b/share/man/man4/if_bridge.4
@@ -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
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index c7987c2..bd0958e 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -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);
OpenPOWER on IntegriCloud