diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2009-04-15 15:31:32 -0400 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2009-05-08 04:30:48 -0400 |
commit | 9452258d8173806f67b1be5b3b00c39b052060c8 (patch) | |
tree | 68bf3c4de828d30428c0e4c9a8f97eb05cf424fb | |
parent | a1ff4ac84e58503691058e88d55fa48949822683 (diff) |
netfilter: xtables: remove some goto
Combining two ifs, and goto is easily gone.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 7 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 82888bc6bc1a..cfcb7af91724 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -359,15 +359,12 @@ ipt_do_table(struct sk_buff *skb, | |||
359 | IP_NF_ASSERT(e); | 359 | IP_NF_ASSERT(e); |
360 | IP_NF_ASSERT(back); | 360 | IP_NF_ASSERT(back); |
361 | if (!ip_packet_match(ip, indev, outdev, | 361 | if (!ip_packet_match(ip, indev, outdev, |
362 | &e->ip, mtpar.fragoff)) { | 362 | &e->ip, mtpar.fragoff) || |
363 | no_match: | 363 | IPT_MATCH_ITERATE(e, do_match, skb, &mtpar) != 0) { |
364 | e = ipt_next_entry(e); | 364 | e = ipt_next_entry(e); |
365 | continue; | 365 | continue; |
366 | } | 366 | } |
367 | 367 | ||
368 | if (IPT_MATCH_ITERATE(e, do_match, skb, &mtpar) != 0) | ||
369 | goto no_match; | ||
370 | |||
371 | ADD_COUNTER(e->counters, ntohs(ip->tot_len), 1); | 368 | ADD_COUNTER(e->counters, ntohs(ip->tot_len), 1); |
372 | 369 | ||
373 | t = ipt_get_target(e); | 370 | t = ipt_get_target(e); |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index a6c2213f821e..d01b8a39fbd8 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -386,15 +386,12 @@ ip6t_do_table(struct sk_buff *skb, | |||
386 | IP_NF_ASSERT(e); | 386 | IP_NF_ASSERT(e); |
387 | IP_NF_ASSERT(back); | 387 | IP_NF_ASSERT(back); |
388 | if (!ip6_packet_match(skb, indev, outdev, &e->ipv6, | 388 | if (!ip6_packet_match(skb, indev, outdev, &e->ipv6, |
389 | &mtpar.thoff, &mtpar.fragoff, &hotdrop)) { | 389 | &mtpar.thoff, &mtpar.fragoff, &hotdrop) || |
390 | no_match: | 390 | IP6T_MATCH_ITERATE(e, do_match, skb, &mtpar) != 0) { |
391 | e = ip6t_next_entry(e); | 391 | e = ip6t_next_entry(e); |
392 | continue; | 392 | continue; |
393 | } | 393 | } |
394 | 394 | ||
395 | if (IP6T_MATCH_ITERATE(e, do_match, skb, &mtpar) != 0) | ||
396 | goto no_match; | ||
397 | |||
398 | ADD_COUNTER(e->counters, | 395 | ADD_COUNTER(e->counters, |
399 | ntohs(ipv6_hdr(skb)->payload_len) + | 396 | ntohs(ipv6_hdr(skb)->payload_len) + |
400 | sizeof(struct ipv6hdr), 1); | 397 | sizeof(struct ipv6hdr), 1); |