Magellan Linux

Contents of /trunk/iproute2/patches/iproute2-2.6.39-xtables-api-6-fix.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1543 - (show annotations) (download)
Tue Oct 4 14:33:58 2011 UTC (12 years, 6 months ago) by niro
File size: 2316 byte(s)
added buildfix against newer iptables/xtables api
1 From 73de5d96804160e3e399bd81b135053f70b27e7b Mon Sep 17 00:00:00 2001
2 From: Andreas Henriksson <andreas@fatal.se>
3 Date: Mon, 4 Jul 2011 05:17:42 +0000
4 Subject: [PATCH] iproute2: Fix building xt module against xtables version 6
5
6 iptables/xtables apparently changed API again.... Now you need to pass
7 and extra parameter (orig_opts) which was not needed before.
8
9 Sprinkle some lovely pre-processor magic to be compatible with both older
10 and new versions. In the beginning of times XTABLES_VERSION_CODE didn't
11 exist. Then it was (0x10000 * major + 0x100 * minor + patch) when it was
12 first introduced (according to git), but now it's at 6...
13 Don't know what official iptables releases has defined it to over time.
14 Lets just hope none of the older versions with is has the define
15 higher then 6 is still around.... so only the "current" versioning
16 scheme is supported.... lets see how long this lasts now.
17
18 For the API change in xtables, see:
19 http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commitdiff;h=600f38db82548a683775fd89b6e136673e924097
20
21 Signed-off-by: Andreas Henriksson <andreas@fatal.se>
22 ---
23 tc/m_xt.c | 16 ++++++++++++----
24 1 files changed, 12 insertions(+), 4 deletions(-)
25
26 diff --git a/tc/m_xt.c b/tc/m_xt.c
27 index 651a59e..13bf19f 100644
28 --- a/tc/m_xt.c
29 +++ b/tc/m_xt.c
30 @@ -160,9 +160,13 @@ static int parse_ipt(struct action_util *a,int *argc_p,
31 return -1;
32 }
33 tcipt_globals.opts =
34 - xtables_merge_options(tcipt_globals.opts,
35 - m->extra_opts,
36 - &m->option_offset);
37 + xtables_merge_options(
38 +#if (XTABLES_VERSION_CODE >= 6)
39 + tcipt_globals.orig_opts,
40 +#endif
41 + tcipt_globals.opts,
42 + m->extra_opts,
43 + &m->option_offset);
44 } else {
45 fprintf(stderr," failed to find target %s\n\n", optarg);
46 return -1;
47 @@ -305,7 +309,11 @@ print_ipt(struct action_util *au,FILE * f, struct rtattr *arg)
48 }
49
50 tcipt_globals.opts =
51 - xtables_merge_options(tcipt_globals.opts,
52 + xtables_merge_options(
53 +#if (XTABLES_VERSION_CODE >= 6)
54 + tcipt_globals.orig_opts,
55 +#endif
56 + tcipt_globals.opts,
57 m->extra_opts,
58 &m->option_offset);
59 } else {
60 --
61 1.7.4.4
62