Re: custom target: vlan_t extension problem.
Dawid Ciezarkiewicz <[email protected]>
| Newsgroups | gmane.linux.network.bridge.ebtables.devel |
|---|---|
| Organization | ASN |
| Message-ID | <[email protected]> |
On Friday, 7 July 2006 12:58, [email protected] wrote: > 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? After long fight I have managed to get this piece of code to work. :) The problem was that __vlan_put_tag() is expecting skb->data pointer to point in other place then it is in ebtables. As for me - whole __vlan_put_tag() is broken or I just don't get it. Because of very low traffic on this list I've decided to post my work on netdev mailing list. I thought that if ebtables is now part of 2.6 kernel it may be more appropriate place to ask - especially when I've got working target. http://marc.theaimsgroup.com/?l=linux-netdev&m=115212914212035&w=2 ^^^ Here you can see my working (but now well tested yet) ebt_vlan_t target. Some people already helped me improve it - i fixed unportable types (unsigned short), droped info->target, replaced "two bytes" with "four bytes" etc., but nobody has commented whole functionality yet. As you can see I almost rewritten __vlan_put_tag(). My objections are placed inside comments. What I'd like to point out is - (use this link to kernel source): http://lxr.xensource.com/lxr/source/linux-2.6.16-xen/include/linux/if_vlan.h#L221 Line 241: veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); is IMHO plain wrong. skb_push() returns sbk->data pointer, while `struct vlan_ethhdr *' should be made from mac.raw pointer IMO. Line 254: skb->nh.raw -= VLAN_HLEN; Is wrong too - this header hasn't moved - we moved mac header four bytes left, so ip headers are still in good place. But as you can see I'm very novice and little to ashamed to point out bugs in real, working kernel code. It'd be good if somebody could review my opinions. Regards, 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