Re: bridge-netfilter patch

From: Bart De Schuymer (bart.de.schuymer@pandora.be)
Date: Sat Sep 14 2002 - 02:05:40 EST


On Friday 13 September 2002 20:22, David S. Miller wrote:
> From: Lennert Buytenhek <buytenh@math.leidenuniv.nl>
> Date: Fri, 13 Sep 2002 14:45:18 +0200
>
> > You need to remove the IPv4 bits, that copy of the MAC has to happen
> > at a different layer, it does not belong in IPv4. At best, everyone
> > shouldn't eat that header copy.
>
> What if I make the memcpy conditional on "if (skb->physindev != NULL)"?
>
> First explain to me why the copy is needed for.

memcpy(skb2->data - 16, skb->data - 16, 16);

This is for purely bridged packets.
IP connection tracking first gathers all fragments, before the bridged IP
packets are sent out the packet is fragmented. However, since this
fragmenting actually happens while the IP packet "is in the bridge code", no
existing code makes sure the fragments' Ethernet headers are correctly
filled. Now, AFAIK an Ethernet header has length 14 bytes, so don't ask me
why the magic number 16 is used (Lennert got IP fragmenting fixed).
A nice comment in front of that copy is certainly needed...

-- 
cheers,
Bart

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Sep 15 2002 - 22:00:36 EST