summaryrefslogtreecommitdiff
path: root/net/netfilter/core.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2011-01-18 15:27:28 +0100
committerPatrick McHardy <kaber@trash.net>2011-01-18 15:27:28 +0100
commitf15850861860636c905b33a9a5be3dcbc2b0d56a (patch)
tree463d73647de2a43138bdd8259c259137a3bb3e3b /net/netfilter/core.c
parent5f2cafe73671d865af88494159f3e8c1b322e1c5 (diff)
netfilter: nfnetlink_queue: return error number to caller
instead of returning -1 on error, return an error number to allow the caller to handle some errors differently. ECANCELED is used to indicate that the hook is going away and should be ignored. A followup patch will introduce more 'ignore this hook' conditions, (depending on queue settings) and will move kfree_skb responsibility to the caller. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/core.c')
-rw-r--r--net/netfilter/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index e69d537362c7..91d66d2f8cd9 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -179,9 +179,11 @@ next_hook:
if (ret == 0)
ret = -EPERM;
} else if ((verdict & NF_VERDICT_MASK) == NF_QUEUE) {
- if (!nf_queue(skb, elem, pf, hook, indev, outdev, okfn,
- verdict >> NF_VERDICT_BITS))
+ ret = nf_queue(skb, elem, pf, hook, indev, outdev, okfn,
+ verdict >> NF_VERDICT_BITS);
+ if (ret == -ECANCELED)
goto next_hook;
+ ret = 0;
}
rcu_read_unlock();
return ret;