Florian Westphal df122f58b8 netfilter: ingress: translate 0 nf_hook_slow retval to -1
The caller assumes that < 0 means that skb was stolen (or free'd).

All other return values continue skb processing.

nf_hook_slow returns 3 different return value types:

A) a (negative) errno value: the skb was dropped (NF_DROP, e.g.
by iptables '-j DROP' rule).

B) 0. The skb was stolen by the hook or queued to userspace.

C) 1. all hooks returned NF_ACCEPT so the caller should invoke
   the okfn so packet processing can continue.

nft ingress facility currently doesn't have the 'okfn' that
the NF_HOOK() macros use; there is no nfqueue support either.

So 1 means that nf_hook_ingress() caller should go on processing the skb.

In order to allow use of NF_STOLEN from ingress we need to translate
this to an errno number, else we'd crash because we continue with
already-free'd (or about to be free-d) skb.

The errno value isn't checked, its just important that its less than 0,
so return -1.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2016-12-06 21:48:21 +01:00
..
2016-10-12 11:01:37 -07:00
2016-05-09 16:18:37 +02:00
2016-03-04 23:50:27 -06:00
2016-10-07 08:35:35 -07:00
2016-10-05 11:34:53 -07:00
2016-10-11 13:22:22 -07:00
2016-07-08 16:23:11 +02:00
2016-09-14 20:37:50 +02:00
2016-11-11 23:23:02 +01:00
2016-08-25 11:26:48 -04:00
2016-09-14 09:18:06 -06:00
2016-06-07 13:41:38 -06:00
2016-08-11 09:41:35 -06:00
2016-09-27 21:20:53 -04:00
2016-08-02 19:35:24 -04:00
2016-10-07 18:46:30 -07:00
2016-11-15 22:34:25 -05:00
2016-06-07 13:41:38 -06:00
2016-05-17 15:48:12 -04:00
2016-10-30 13:09:42 -04:00
2016-10-07 15:15:33 -07:00
2016-09-16 12:44:20 +02:00
2016-07-22 09:07:02 +02:00
2016-09-24 10:48:18 +02:00
2016-10-20 15:51:28 +11:00
2016-09-16 09:34:15 +01:00
2016-09-14 09:18:09 -06:00
2016-09-20 23:20:32 +02:00
2016-05-11 22:37:54 +02:00
2016-03-22 15:36:02 -07:00
2016-08-10 11:23:44 -04:00
2016-03-22 15:36:02 -07:00
2016-09-15 16:49:39 +02:00
2016-09-14 12:57:43 -07:00
2016-09-27 12:33:47 +02:00
2016-03-17 13:47:50 -07:00
2016-10-24 19:13:20 -07:00
2016-08-04 10:16:55 +09:30
2016-07-29 12:17:52 -07:00
2016-08-28 23:32:41 -04:00
2016-06-03 19:37:21 -04:00
2016-11-16 18:32:02 -05:00
2016-04-25 15:09:11 -04:00
2016-10-19 11:36:22 -06:00
2016-05-02 09:00:56 -05:00
2016-07-08 18:14:03 -03:00
2016-11-23 16:23:23 -06:00
2016-03-14 15:43:11 -04:00
2016-10-31 16:18:30 -04:00
2016-10-14 11:36:59 -07:00
2016-07-12 19:25:38 -07:00
2016-09-27 21:52:00 -04:00
2016-09-08 15:01:10 -07:00
2016-09-08 15:01:10 -07:00
2016-03-17 15:09:34 -07:00
2016-07-06 10:51:14 +01:00
2016-09-20 04:43:36 -04:00
2016-03-22 15:36:02 -07:00
2016-07-26 16:19:19 -07:00
2016-09-08 22:15:25 -07:00
2016-06-14 10:54:40 -07:00
2016-09-06 18:30:20 +02:00
2016-05-08 23:46:14 -04:00
2016-10-05 18:23:36 -04:00
2016-10-07 18:46:27 -07:00
2016-06-20 12:47:15 -07:00
2016-07-19 17:43:38 +03:00
2016-05-20 20:57:27 -07:00
2016-05-23 17:04:14 -07:00
2016-04-07 16:53:29 -04:00
2016-07-26 16:19:19 -07:00
2016-05-20 17:58:30 -07:00
2016-02-22 16:10:08 -07:00
2016-06-25 09:04:48 -07:00
2016-09-30 10:54:03 +02:00
2016-08-29 08:13:21 -06:00