Skip to contentSkip to conversation

Match & target structure history in 2.4.28 and 2.6.x series

DISCUSSION Jonas Berlin 2 participants 5 messages Jan 11, 2007 – Jan 12, 2007 netfilter

lore
Share & tools
lore
#0 lore raw

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:

http://svn.netfilter.org/cgi-bin/viewcvs.cgi/trunk/patch-o-matic-ng/patchlets/set/linux-2.6/net/ipv4/netfilter/ipt_set.c?view=markup

- 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.2006
#1 lore raw
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).

	-`J'
#2 lore raw
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

#3 lore raw
In reply to Jan Engelhardt
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'
#4 lore raw
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
#endif

void 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..?