diff options
| author | Jan Engelhardt <jengelh@medozas.de> | 2009-06-05 11:31:46 -0400 |
|---|---|---|
| committer | Jan Engelhardt <jengelh@medozas.de> | 2010-02-15 10:56:51 -0500 |
| commit | 23f3733d440b918ccb7746718f77256334cf6176 (patch) | |
| tree | e074482e69865c88269a09f2e0537450f2796c74 /include/linux | |
| parent | fa96a0e2e67fe34a3d994e3f354a5c229dd14286 (diff) | |
netfilter: reduce NF_HOOK by one argument
No changes in vmlinux filesize.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netfilter.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 78f33d22368..2f22816a551 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
| @@ -163,11 +163,8 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, | |||
| 163 | struct sk_buff *skb, | 163 | struct sk_buff *skb, |
| 164 | struct net_device *indev, | 164 | struct net_device *indev, |
| 165 | struct net_device *outdev, | 165 | struct net_device *outdev, |
| 166 | int (*okfn)(struct sk_buff *), int thresh, | 166 | int (*okfn)(struct sk_buff *), int thresh) |
| 167 | int cond) | ||
| 168 | { | 167 | { |
| 169 | if (!cond) | ||
| 170 | return 1; | ||
| 171 | #ifndef CONFIG_NETFILTER_DEBUG | 168 | #ifndef CONFIG_NETFILTER_DEBUG |
| 172 | if (list_empty(&nf_hooks[pf][hook])) | 169 | if (list_empty(&nf_hooks[pf][hook])) |
| 173 | return 1; | 170 | return 1; |
| @@ -179,7 +176,7 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, | |||
| 179 | struct net_device *indev, struct net_device *outdev, | 176 | struct net_device *indev, struct net_device *outdev, |
| 180 | int (*okfn)(struct sk_buff *)) | 177 | int (*okfn)(struct sk_buff *)) |
| 181 | { | 178 | { |
| 182 | return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1); | 179 | return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN); |
| 183 | } | 180 | } |
| 184 | 181 | ||
| 185 | /* Activate hook; either okfn or kfree_skb called, unless a hook | 182 | /* 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 | 203 | ||
| 207 | #define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ | 204 | #define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ |
| 208 | ({int __ret; \ | 205 | ({int __ret; \ |
| 209 | if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh, 1)) == 1)\ | 206 | if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh)) == 1)\ |
| 210 | __ret = (okfn)(skb); \ | 207 | __ret = (okfn)(skb); \ |
| 211 | __ret;}) | 208 | __ret;}) |
| 212 | 209 | ||
| 213 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \ | 210 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \ |
| 214 | ({int __ret; \ | 211 | ({int __ret; \ |
| 215 | if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\ | 212 | if ((cond) || (__ret = nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN)) == 1)\ |
| 216 | __ret = (okfn)(skb); \ | 213 | __ret = (okfn)(skb); \ |
| 217 | __ret;}) | 214 | __ret;}) |
| 218 | 215 | ||
| @@ -328,8 +325,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, | |||
| 328 | struct sk_buff *skb, | 325 | struct sk_buff *skb, |
| 329 | struct net_device *indev, | 326 | struct net_device *indev, |
| 330 | struct net_device *outdev, | 327 | struct net_device *outdev, |
| 331 | int (*okfn)(struct sk_buff *), int thresh, | 328 | int (*okfn)(struct sk_buff *), int thresh) |
| 332 | int cond) | ||
| 333 | { | 329 | { |
| 334 | return okfn(skb); | 330 | return okfn(skb); |
| 335 | } | 331 | } |
