Commit 4bac6b180771f7ef5275b1a6d88e630ca3a3d6f0

Authored by Patrick McHardy
1 parent 37ee3d5b3e

netfilter: restore POST_ROUTING hook in NF_HOOK_COND

Commit 2249065 ("netfilter: get rid of the grossness in netfilter.h")
inverted the logic for conditional hook invocation, breaking the
POST_ROUTING hook invoked by ip_output().

Correct the logic and remove an unnecessary initialization.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

include/linux/netfilter.h
... ... @@ -212,8 +212,9 @@
212 212 struct net_device *in, struct net_device *out,
213 213 int (*okfn)(struct sk_buff *), bool cond)
214 214 {
215   - int ret = 1;
216   - if (cond ||
  215 + int ret;
  216 +
  217 + if (!cond ||
217 218 (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1))
218 219 ret = okfn(skb);
219 220 return ret;