From 7550968a4539d65e1533f23ea926529994248a79 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 8 Oct 2008 11:35:16 +0200 Subject: [PATCH] --- yaml --- r: 112120 b: refs/heads/master c: 5365f8022e04310f0276c95e82548da917d514db h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/bridge/netfilter/ebtables.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 4c57c422e0b2..7f7278d49ee1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f2ff525c8dae57b3cda51d76443f60f764f34202 +refs/heads/master: 5365f8022e04310f0276c95e82548da917d514db diff --git a/trunk/net/bridge/netfilter/ebtables.c b/trunk/net/bridge/netfilter/ebtables.c index c4f7a2e8ed39..7964d3f03886 100644 --- a/trunk/net/bridge/netfilter/ebtables.c +++ b/trunk/net/bridge/netfilter/ebtables.c @@ -78,9 +78,10 @@ static inline int ebt_do_watcher (struct ebt_entry_watcher *w, static inline int ebt_do_match (struct ebt_entry_match *m, const struct sk_buff *skb, const struct net_device *in, - const struct net_device *out) + const struct net_device *out, bool *hotdrop) { - return m->u.match->match(skb, in, out, m->u.match, m->data, 0, 0, NULL); + return m->u.match->match(skb, in, out, m->u.match, + m->data, 0, 0, hotdrop); } static inline int ebt_dev_check(char *entry, const struct net_device *device) @@ -156,6 +157,7 @@ unsigned int ebt_do_table (unsigned int hook, struct sk_buff *skb, struct ebt_entries *chaininfo; char *base; struct ebt_table_info *private; + bool hotdrop = false; read_lock_bh(&table->lock); private = table->private; @@ -176,8 +178,13 @@ unsigned int ebt_do_table (unsigned int hook, struct sk_buff *skb, if (ebt_basic_match(point, eth_hdr(skb), in, out)) goto letscontinue; - if (EBT_MATCH_ITERATE(point, ebt_do_match, skb, in, out) != 0) + if (EBT_MATCH_ITERATE(point, ebt_do_match, skb, + in, out, &hotdrop) != 0) goto letscontinue; + if (hotdrop) { + read_unlock_bh(&table->lock); + return NF_DROP; + } /* increase counter */ (*(counter_base + i)).pcnt++;