Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195063
b: refs/heads/master
c: ef53d70
h: refs/heads/master
i:
  195061: ee77ed9
  195059: b3d2e46
  195055: b466331
v: v3
  • Loading branch information
Jan Engelhardt committed May 2, 2010
1 parent 7ff0dcf commit ed07661
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c29c949288d343be0d5c4f3091bc87ac047e1a09
refs/heads/master: ef53d702c3614fb919e8a8291033e3dbccfd1aea
22 changes: 5 additions & 17 deletions trunk/net/ipv4/netfilter/ip_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,6 @@ ipt_error(struct sk_buff *skb, const struct xt_target_param *par)
return NF_DROP;
}

/* Performance critical - called for every packet */
static inline bool
do_match(const struct ipt_entry_match *m, const struct sk_buff *skb,
struct xt_match_param *par)
{
par->match = m->u.kernel.match;
par->matchinfo = m->data;

/* Stop iteration if it doesn't match */
if (!m->u.kernel.match->match(skb, par))
return true;
else
return false;
}

/* Performance critical */
static inline struct ipt_entry *
get_entry(const void *base, unsigned int offset)
Expand Down Expand Up @@ -379,9 +364,12 @@ ipt_do_table(struct sk_buff *skb,
continue;
}

xt_ematch_foreach(ematch, e)
if (do_match(ematch, skb, &mtpar) != 0)
xt_ematch_foreach(ematch, e) {
mtpar.match = ematch->u.kernel.match;
mtpar.matchinfo = ematch->data;
if (!mtpar.match->match(skb, &mtpar))
goto no_match;
}

ADD_COUNTER(e->counters, ntohs(ip->tot_len), 1);

Expand Down
22 changes: 5 additions & 17 deletions trunk/net/ipv6/netfilter/ip6_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,21 +205,6 @@ ip6t_error(struct sk_buff *skb, const struct xt_target_param *par)
return NF_DROP;
}

/* Performance critical - called for every packet */
static inline bool
do_match(const struct ip6t_entry_match *m, const struct sk_buff *skb,
struct xt_match_param *par)
{
par->match = m->u.kernel.match;
par->matchinfo = m->data;

/* Stop iteration if it doesn't match */
if (!m->u.kernel.match->match(skb, par))
return true;
else
return false;
}

static inline struct ip6t_entry *
get_entry(const void *base, unsigned int offset)
{
Expand Down Expand Up @@ -402,9 +387,12 @@ ip6t_do_table(struct sk_buff *skb,
continue;
}

xt_ematch_foreach(ematch, e)
if (do_match(ematch, skb, &mtpar) != 0)
xt_ematch_foreach(ematch, e) {
mtpar.match = ematch->u.kernel.match;
mtpar.matchinfo = ematch->data;
if (!mtpar.match->match(skb, &mtpar))
goto no_match;
}

ADD_COUNTER(e->counters,
ntohs(ipv6_hdr(skb)->payload_len) +
Expand Down

0 comments on commit ed07661

Please sign in to comment.