mirror of
https://github.com/torvalds/linux.git
synced 2024-12-15 15:41:58 +00:00
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>
This commit is contained in:
parent
37ee3d5b3e
commit
4bac6b1807
@ -212,8 +212,9 @@ NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb,
|
|||||||
struct net_device *in, struct net_device *out,
|
struct net_device *in, struct net_device *out,
|
||||||
int (*okfn)(struct sk_buff *), bool cond)
|
int (*okfn)(struct sk_buff *), bool cond)
|
||||||
{
|
{
|
||||||
int ret = 1;
|
int ret;
|
||||||
if (cond ||
|
|
||||||
|
if (!cond ||
|
||||||
(ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1))
|
(ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1))
|
||||||
ret = okfn(skb);
|
ret = okfn(skb);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user