Match & target structure history in 2.4.28 and 2.6.x series
In the hope that it will help people write matches & targets that are compatible with not only the newest version of linux, I wrote a page showing the changes to the match & target structs used in kernel code in the 2.6 series since 2.4.28:
http://xkr47.outerspace.dyndns.org/netfilter/match_and_target_structure_history.html
There has been quite a lot of changes in fact, and often ipv6 changes have appeared later than ipv4 changes.
I also included the transition from ipt_* and ip6t_* structs to xt_* structs in 2.6.16.
I'll try to write some skeleton examples later on how to do the basic backwards compatibility.. if I have time.. meanwhile, you get some idea by looking at this example.. check the #if statements:
- xkr47
Signature · 5 lines
"if I'd make up my own definitions, unrational would be the the end
result after someone unrationalized something i.e. actively worked
to cut down on rationality, whereas irrational would be more a
result of laziness or lack of skill"
- me, 23.11.2006Quoted 5 lines
In the hope that it will help people write matches & targets that are compatible with not only the newest version of linux, I wrote a page showing the changes to the match & target structs used in kernel code in the 2.6 series since 2.4.28:
You could add 2.6.20-rc4 (to become 2.6.20).
-`J'
Quoted 6 lines · Jan Engelhardt
Quoted 4 lines
In the hope that it will help people write matches & targets that are compatible with not only the newest version of linux, I wrote a page showing the changes to the match & target structs used in kernel code in the 2.6 series since 2.4.28:
You could add 2.6.20-rc4 (to become 2.6.20).
Do you mean I should add "(to become 2.6.20)" after 2.6.20-rc4 ? I have 2.6.20-rc4 in there already.. :)
- xkr47
Quoted 7 lines
Quoted 5 lines
In the hope that it will help people write matches & targets that are compatible with not only the newest version of linux, I wrote a page showing the changes to the match & target structs used in kernel code in the 2.6 series since 2.4.28:
You could add 2.6.20-rc4 (to become 2.6.20).
Oh right. Well, I just thought of this peculiarity in 2.6.20:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
# define nfmark mark
#endif
void foobar(struct sk_buff *skb) {
printk("Mark is %d\n", skb->nfmark);
}-`J'
Quoted 8 lines · Jan Engelhardt
Quoted 5 lines
Quoted 4 lines
In the hope that it will help people write matches & targets that are compatible with not only the newest version of linux, I wrote a page showing the changes to the match & target structs used in kernel code in the 2.6 series since 2.4.28:
You could add 2.6.20-rc4 (to become 2.6.20).
Oh right. Well, I just thought of this peculiarity in 2.6.20:
Quoted 7 lines
#if
LINUX_VERSION_CODE>=KERNEL_VERSION(2, 6, 20)
# define nfmark mark
#endifvoid foobar(struct sk_buff *skb) { printk("Mark is %d\n", skb->nfmark); }
Oh right.. well I haven't covered structures other than the *_match and *_target ones.. I'm sure there's a lot else out there that could/should be documented in the same way.. :) Maybe I could create a separate page for sk_buff..?