diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2009-07-05 12:26:37 -0400 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-05-11 12:23:43 -0400 |
commit | de74c16996287250f0d947663127f80c6beebd3c (patch) | |
tree | c7e77e254c5812c8561516dd668eaec732a89a0d /net/ipv6 | |
parent | ef53d702c3614fb919e8a8291033e3dbccfd1aea (diff) |
netfilter: xtables: combine struct xt_match_param and xt_target_param
The structures carried - besides match/target - almost the same data.
It is possible to combine them, as extensions are evaluated serially,
and so, the callers end up a little smaller.
text data bss filename
-15318 740 104 net/ipv4/netfilter/ip_tables.o
+15286 740 104 net/ipv4/netfilter/ip_tables.o
-15333 540 152 net/ipv6/netfilter/ip6_tables.o
+15269 540 152 net/ipv6/netfilter/ip6_tables.o
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index f8ac4a0b5899..076308c1acd7 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -345,8 +345,7 @@ ip6t_do_table(struct sk_buff *skb, | |||
345 | struct ip6t_entry *e, **jumpstack; | 345 | struct ip6t_entry *e, **jumpstack; |
346 | unsigned int *stackptr, origptr, cpu; | 346 | unsigned int *stackptr, origptr, cpu; |
347 | const struct xt_table_info *private; | 347 | const struct xt_table_info *private; |
348 | struct xt_match_param mtpar; | 348 | struct xt_action_param acpar; |
349 | struct xt_target_param tgpar; | ||
350 | 349 | ||
351 | /* Initialization */ | 350 | /* Initialization */ |
352 | indev = in ? in->name : nulldevname; | 351 | indev = in ? in->name : nulldevname; |
@@ -357,11 +356,11 @@ ip6t_do_table(struct sk_buff *skb, | |||
357 | * things we don't know, ie. tcp syn flag or ports). If the | 356 | * things we don't know, ie. tcp syn flag or ports). If the |
358 | * rule is also a fragment-specific rule, non-fragments won't | 357 | * rule is also a fragment-specific rule, non-fragments won't |
359 | * match it. */ | 358 | * match it. */ |
360 | mtpar.hotdrop = &hotdrop; | 359 | acpar.hotdrop = &hotdrop; |
361 | mtpar.in = tgpar.in = in; | 360 | acpar.in = in; |
362 | mtpar.out = tgpar.out = out; | 361 | acpar.out = out; |
363 | mtpar.family = tgpar.family = NFPROTO_IPV6; | 362 | acpar.family = NFPROTO_IPV6; |
364 | mtpar.hooknum = tgpar.hooknum = hook; | 363 | acpar.hooknum = hook; |
365 | 364 | ||
366 | IP_NF_ASSERT(table->valid_hooks & (1 << hook)); | 365 | IP_NF_ASSERT(table->valid_hooks & (1 << hook)); |
367 | 366 | ||
@@ -381,16 +380,16 @@ ip6t_do_table(struct sk_buff *skb, | |||
381 | 380 | ||
382 | IP_NF_ASSERT(e); | 381 | IP_NF_ASSERT(e); |
383 | if (!ip6_packet_match(skb, indev, outdev, &e->ipv6, | 382 | if (!ip6_packet_match(skb, indev, outdev, &e->ipv6, |
384 | &mtpar.thoff, &mtpar.fragoff, &hotdrop)) { | 383 | &acpar.thoff, &acpar.fragoff, &hotdrop)) { |
385 | no_match: | 384 | no_match: |
386 | e = ip6t_next_entry(e); | 385 | e = ip6t_next_entry(e); |
387 | continue; | 386 | continue; |
388 | } | 387 | } |
389 | 388 | ||
390 | xt_ematch_foreach(ematch, e) { | 389 | xt_ematch_foreach(ematch, e) { |
391 | mtpar.match = ematch->u.kernel.match; | 390 | acpar.match = ematch->u.kernel.match; |
392 | mtpar.matchinfo = ematch->data; | 391 | acpar.matchinfo = ematch->data; |
393 | if (!mtpar.match->match(skb, &mtpar)) | 392 | if (!acpar.match->match(skb, &acpar)) |
394 | goto no_match; | 393 | goto no_match; |
395 | } | 394 | } |
396 | 395 | ||
@@ -439,10 +438,10 @@ ip6t_do_table(struct sk_buff *skb, | |||
439 | continue; | 438 | continue; |
440 | } | 439 | } |
441 | 440 | ||
442 | tgpar.target = t->u.kernel.target; | 441 | acpar.target = t->u.kernel.target; |
443 | tgpar.targinfo = t->data; | 442 | acpar.targinfo = t->data; |
444 | 443 | ||
445 | verdict = t->u.kernel.target->target(skb, &tgpar); | 444 | verdict = t->u.kernel.target->target(skb, &acpar); |
446 | if (verdict == IP6T_CONTINUE) | 445 | if (verdict == IP6T_CONTINUE) |
447 | e = ip6t_next_entry(e); | 446 | e = ip6t_next_entry(e); |
448 | else | 447 | else |