diff options
author | Simon Wunderlich <siwu@hrz.tu-chemnitz.de> | 2008-07-30 16:27:55 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-30 16:27:55 -0700 |
commit | 4adf0af6818f3ea52421dc0bae836cfaf20ef72a (patch) | |
tree | 480835bbc913896cd726e3f90d20ce8c859636f7 /net/bridge/br_device.c | |
parent | e62112c53acfefc67ccfbdc1895eebccf866bc1b (diff) | |
download | op-kernel-dev-4adf0af6818f3ea52421dc0bae836cfaf20ef72a.zip op-kernel-dev-4adf0af6818f3ea52421dc0bae836cfaf20ef72a.tar.gz |
bridge: send correct MTU value in PMTU (revised)
When bridging interfaces with different MTUs, the bridge correctly chooses
the minimum of the MTUs of the physical devices as the bridges MTU. But
when a frame is passed which fits through the incoming, but not through
the outgoing interface, a "Fragmentation Needed" packet is generated.
However, the propagated MTU is hardcoded to 1500, which is wrong in this
situation. The sender will repeat the packet again with the same frame
size, and the same problem will occur again.
Instead of sending 1500, the (correct) MTU value of the bridge is now sent
via PMTU. To achieve this, the corresponding rtable structure is stored
in its net_bridge structure.
Modified to get rid of fake_net_device as well.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_device.c')
-rw-r--r-- | net/bridge/br_device.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index d9449df..9b58d70 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c @@ -68,10 +68,17 @@ static int br_dev_stop(struct net_device *dev) static int br_change_mtu(struct net_device *dev, int new_mtu) { - if (new_mtu < 68 || new_mtu > br_min_mtu(netdev_priv(dev))) + struct net_bridge *br = netdev_priv(dev); + if (new_mtu < 68 || new_mtu > br_min_mtu(br)) return -EINVAL; dev->mtu = new_mtu; + +#ifdef CONFIG_BRIDGE_NETFILTER + /* remember the MTU in the rtable for PMTU */ + br->fake_rtable.u.dst.metrics[RTAX_MTU - 1] = new_mtu; +#endif + return 0; } |