Re: new frame generation in user-defined target

Bart De Schuymer <[email protected]>
Newsgroups gmane.linux.network.bridge.ebtables.devel
Message-ID <[email protected]>
On Monday 29 November 2004 17:22, Aitor Alvarez Gila wrote:
> Hi,
>
> I'm trying to create a new user-defined target for ebtables, which would
> process incoming frames and insert some management frames into a packet
> flow, and I'd like to know if it would be possible to create a new sk_buff
> and append it to the current socket buffer list (using skb_append(), e.g.)
> in the same target code. Would the kernel handle it correctly?

I think you can do this in a similar way as the ip defragmenting code works. 
Your IP fragments will then be defragmented before sent out of the bridge (if 
connection tracking is in the kernel).

I don't know all the details, but have a look at 
net/ipv4/ip_fragment.c:ip_defrag() for clues.

If you alter the packet, you need to check (skb_shared(*pskb) || 
skb_cloned(*pskb)), see e.g. ebt_redirect.c.

cheers,
Bart



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.