* Fw: [Bridge] Re: Any way of knowing a packet's been defragmented
@ 2004-08-06 16:13 Stephen Hemminger
2004-08-06 20:21 ` David S. Miller
2004-08-09 23:52 ` David S. Miller
0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2004-08-06 16:13 UTC (permalink / raw)
To: David S. Miller; +Cc: bridge
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>
diff -Nru a/net/bridge/br_forward.c b/net/bridge/br_forward.c
--- a/net/bridge/br_forward.c 2004-08-06 09:12:41 -07:00
+++ b/net/bridge/br_forward.c 2004-08-06 09:12:41 -07:00
@@ -23,7 +23,6 @@
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 @@
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;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-08-09 23:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-06 16:13 Fw: [Bridge] Re: Any way of knowing a packet's been defragmented Stephen Hemminger
2004-08-06 20:21 ` David S. Miller
2004-08-09 23:52 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox