Re: custom target: vlan_t extension problem.

"[email protected]" <[email protected]>
Newsgroups gmane.linux.network.bridge.ebtables.devel
Message-ID <[email protected]>
>----- Oorspronkelijk bericht -----
>Van: Dawid Ci??arkiewicz [mailto:[email protected]]
>Verzonden: dinsdag, juli 4, 2006 01:36 PM
>Aan: [email protected]
>Onderwerp: [Ebtables-devel] custom target: vlan_t extension problem.
>
>Hi,
> I'm trying to develop ebt-vlan_t extension for ebtables. It should change 
>vlan ID of ethernet frame. Having most of work already done I'm experiencing 
>problems with changing frame type from non-vlan to vlan.
>
>While the second part (when (*pskb)->protocol == 
>__constant_htons(ETH_P_8021Q)) works perfectly fine and frame VID is changed, 
>the first one is now mix of my tries not to hang kernel.
>
>At the beginning I was going to use  vlan_put_tag(*pskb, info->id); or 
>__vlan_put_tag(*pskb, info->id);
>, but they hang. So I tried many combinations of hand made and 
>found&look-promising code in kernel source.
>
>I'm probably not aware of many facts, because I'm totally kernel newbie. What 
>I'd like to ask especially is:
>- can ebt target modify pskb or substitute it with another one (struct sk_buff 
>**pskb is used for that, I suppose); are there any additional conditions 
>(chains, tables etc.)?

Yes, you can do that. No additional conditions...

>- are there any other limitations for ebt target (locks, interupts ...)?

Nope.

>Of course if anybody can point me anything interesting, like comments and 
>advices (especially about pasted piece of code) I'd be most thankful. I'm not 
>afraid of reading code so please point me function&file if you think I should 
>read it more carefully.

The code doesn't look bad. Apart from the below line you forgot to paste from
__vlan_put_tag() I don't directly see a problem.
skb->protocol = __constant_htons(ETH_P_8021Q);
What isn't happening as expected?

cheers,
Bart





-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
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.