Commit 23f3733d authored by Jan Engelhardt's avatar Jan Engelhardt

netfilter: reduce NF_HOOK by one argument

No changes in vmlinux filesize.
Signed-off-by: default avatarJan Engelhardt <jengelh@medozas.de>
parent fa96a0e2
...@@ -163,11 +163,8 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, ...@@ -163,11 +163,8 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
struct sk_buff *skb, struct sk_buff *skb,
struct net_device *indev, struct net_device *indev,
struct net_device *outdev, struct net_device *outdev,
int (*okfn)(struct sk_buff *), int thresh, int (*okfn)(struct sk_buff *), int thresh)
int cond)
{ {
if (!cond)
return 1;
#ifndef CONFIG_NETFILTER_DEBUG #ifndef CONFIG_NETFILTER_DEBUG
if (list_empty(&nf_hooks[pf][hook])) if (list_empty(&nf_hooks[pf][hook]))
return 1; return 1;
...@@ -179,7 +176,7 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, ...@@ -179,7 +176,7 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
struct net_device *indev, struct net_device *outdev, struct net_device *indev, struct net_device *outdev,
int (*okfn)(struct sk_buff *)) int (*okfn)(struct sk_buff *))
{ {
return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1); return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN);
} }
/* Activate hook; either okfn or kfree_skb called, unless a hook /* Activate hook; either okfn or kfree_skb called, unless a hook
...@@ -206,13 +203,13 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, ...@@ -206,13 +203,13 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ #define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \
({int __ret; \ ({int __ret; \
if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh, 1)) == 1)\ if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh)) == 1)\
__ret = (okfn)(skb); \ __ret = (okfn)(skb); \
__ret;}) __ret;})
#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \ #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \
({int __ret; \ ({int __ret; \
if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\ if ((cond) || (__ret = nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN)) == 1)\
__ret = (okfn)(skb); \ __ret = (okfn)(skb); \
__ret;}) __ret;})
...@@ -328,8 +325,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, ...@@ -328,8 +325,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
struct sk_buff *skb, struct sk_buff *skb,
struct net_device *indev, struct net_device *indev,
struct net_device *outdev, struct net_device *outdev,
int (*okfn)(struct sk_buff *), int thresh, int (*okfn)(struct sk_buff *), int thresh)
int cond)
{ {
return okfn(skb); return okfn(skb);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment