aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2004-08-09 02:40:29 -0700
committerStephen Hemminger <shemminger@osdl.org>2004-08-09 02:40:29 -0700
commit5b4596c7e3ff02e1d694e498f539745bacf6d98e (patch)
tree046de049d28b8bf84c01f62d41a28ebf084a6bd7 /net
parent2b5be1a70f4d64c7f20db984019df0a329dd2507 (diff)
downloadhistory-5b4596c7e3ff02e1d694e498f539745bacf6d98e.tar.gz
[BRIDGE]: Fix problems with filtering and defragmentation.
Dave, this patch from Bart De Schuymer <bdschuym@pandora.be> fixes problems when using filtering and defragmentation. The bridge needs to enforce the MTU restriction after going through the filtering chain not before, because the incoming filter may have reassembled an IP packet, that then needs to be fragmented on the output chain. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br_forward.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index fd5fa75a3525fb..ef9f2095f96e37 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -23,7 +23,6 @@ static inline int should_deliver(const struct net_bridge_port *p,
const struct sk_buff *skb)
{
if (skb->dev == p->dev ||
- skb->len > p->dev->mtu ||
p->state != BR_STATE_FORWARDING)
return 0;
@@ -32,13 +31,17 @@ static inline int should_deliver(const struct net_bridge_port *p,
int br_dev_queue_push_xmit(struct sk_buff *skb)
{
+ if (skb->len > skb->dev->mtu)
+ kfree_skb(skb);
+ else {
#ifdef CONFIG_BRIDGE_NETFILTER
- /* ip_refrag calls ip_fragment, which doesn't copy the MAC header. */
- nf_bridge_maybe_copy_header(skb);
+ /* ip_refrag calls ip_fragment, doesn't copy the MAC header. */
+ nf_bridge_maybe_copy_header(skb);
#endif
- skb_push(skb, ETH_HLEN);
+ skb_push(skb, ETH_HLEN);
- dev_queue_xmit(skb);
+ dev_queue_xmit(skb);
+ }
return 0;
}