diff options
author | Changli Gao <xiaosuo@gmail.com> | 2010-08-02 17:06:19 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-08-02 17:06:19 +0200 |
commit | ee92d37861a90b8f14fa621ae5abcfb29a89aaa9 (patch) | |
tree | ead832fad372e9802d51914ebd6a8f3ce8edd4ce /include/net/netfilter | |
parent | 24b36f0193467fa727b85b4c004016a8dae999b9 (diff) | |
download | kernel_samsung_crespo-ee92d37861a90b8f14fa621ae5abcfb29a89aaa9.zip kernel_samsung_crespo-ee92d37861a90b8f14fa621ae5abcfb29a89aaa9.tar.gz kernel_samsung_crespo-ee92d37861a90b8f14fa621ae5abcfb29a89aaa9.tar.bz2 |
netfilter: nf_conntrack_extend: introduce __nf_ct_ext_exist()
some users of nf_ct_ext_exist() know ct->ext isn't NULL. For these users, the
check for ct->ext isn't necessary, the function __nf_ct_ext_exist() can be
used instead.
the type of the return value of nf_ct_ext_exist() is changed to bool.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/net/netfilter')
-rw-r--r-- | include/net/netfilter/nf_conntrack_extend.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 32d15bd..0772d29 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h @@ -28,9 +28,14 @@ struct nf_ct_ext { char data[0]; }; -static inline int nf_ct_ext_exist(const struct nf_conn *ct, u8 id) +static inline bool __nf_ct_ext_exist(const struct nf_ct_ext *ext, u8 id) { - return (ct->ext && ct->ext->offset[id]); + return !!ext->offset[id]; +} + +static inline bool nf_ct_ext_exist(const struct nf_conn *ct, u8 id) +{ + return (ct->ext && __nf_ct_ext_exist(ct->ext, id)); } static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id) |