mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
![Patrick McHardy](/assets/img/avatar_default.png)
As reported by Randy Dunlap <randy.dunlap@oracle.com>, compilation of nf_defrag_ipv4 fails with: include/net/netfilter/nf_conntrack.h:94: error: field 'ct_general' has incomplete type include/net/netfilter/nf_conntrack.h:178: error: 'const struct sk_buff' has no member named 'nfct' include/net/netfilter/nf_conntrack.h:185: error: implicit declaration of function 'nf_conntrack_put' include/net/netfilter/nf_conntrack.h:294: error: 'const struct sk_buff' has no member named 'nfct' net/ipv4/netfilter/nf_defrag_ipv4.c:45: error: 'struct sk_buff' has no member named 'nfct' net/ipv4/netfilter/nf_defrag_ipv4.c:46: error: 'struct sk_buff' has no member named 'nfct' net/nf_conntrack.h must not be included with NF_CONNTRACK=n, add a few #ifdefs. Long term the header file should be fixed to be usable even with NF_CONNTRACK=n. Tested-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
25 lines
608 B
C
25 lines
608 B
C
#ifndef _NF_CONNTRACK_ZONES_H
|
|
#define _NF_CONNTRACK_ZONES_H
|
|
|
|
#define NF_CT_DEFAULT_ZONE 0
|
|
|
|
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
|
|
#include <net/netfilter/nf_conntrack_extend.h>
|
|
|
|
struct nf_conntrack_zone {
|
|
u16 id;
|
|
};
|
|
|
|
static inline u16 nf_ct_zone(const struct nf_conn *ct)
|
|
{
|
|
#ifdef CONFIG_NF_CONNTRACK_ZONES
|
|
struct nf_conntrack_zone *nf_ct_zone;
|
|
nf_ct_zone = nf_ct_ext_find(ct, NF_CT_EXT_ZONE);
|
|
if (nf_ct_zone)
|
|
return nf_ct_zone->id;
|
|
#endif
|
|
return NF_CT_DEFAULT_ZONE;
|
|
}
|
|
|
|
#endif /* CONFIG_NF_CONNTRACK || CONFIG_NF_CONNTRACK_MODULE */
|
|
#endif /* _NF_CONNTRACK_ZONES_H */
|