diff options
author | KOVACS Krisztian <hidden@balabit.hu> | 2011-01-12 14:25:08 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-01-12 14:25:08 -0500 |
commit | 2fc72c7b84002ffb3c66918e2a7b0ee607d8b5aa (patch) | |
tree | df97dadb97bf3c9b46b7c557d8ac14b9ab1c17b3 /include/linux/skbuff.h | |
parent | 2f46e07995734a363608e974a82fd05d5b610750 (diff) |
netfilter: fix compilation when conntrack is disabled but tproxy is enabled
The IPv6 tproxy patches split IPv6 defragmentation off of conntrack, but
failed to update the #ifdef stanzas guarding the defragmentation related
fields and code in skbuff and conntrack related code in nf_defrag_ipv6.c.
This patch adds the required #ifdefs so that IPv6 tproxy can truly be used
without connection tracking.
Original report:
http://marc.info/?l=linux-netdev&m=129010118516341&w=2
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: KOVACS Krisztian <hidden@balabit.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 20ec0a64cb9f..bf221d65d9ad 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -255,6 +255,11 @@ typedef unsigned int sk_buff_data_t; | |||
255 | typedef unsigned char *sk_buff_data_t; | 255 | typedef unsigned char *sk_buff_data_t; |
256 | #endif | 256 | #endif |
257 | 257 | ||
258 | #if defined(CONFIG_NF_DEFRAG_IPV4) || defined(CONFIG_NF_DEFRAG_IPV4_MODULE) || \ | ||
259 | defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) | ||
260 | #define NET_SKBUFF_NF_DEFRAG_NEEDED 1 | ||
261 | #endif | ||
262 | |||
258 | /** | 263 | /** |
259 | * struct sk_buff - socket buffer | 264 | * struct sk_buff - socket buffer |
260 | * @next: Next buffer in list | 265 | * @next: Next buffer in list |
@@ -362,6 +367,8 @@ struct sk_buff { | |||
362 | void (*destructor)(struct sk_buff *skb); | 367 | void (*destructor)(struct sk_buff *skb); |
363 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 368 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
364 | struct nf_conntrack *nfct; | 369 | struct nf_conntrack *nfct; |
370 | #endif | ||
371 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
365 | struct sk_buff *nfct_reasm; | 372 | struct sk_buff *nfct_reasm; |
366 | #endif | 373 | #endif |
367 | #ifdef CONFIG_BRIDGE_NETFILTER | 374 | #ifdef CONFIG_BRIDGE_NETFILTER |
@@ -2057,6 +2064,8 @@ static inline void nf_conntrack_get(struct nf_conntrack *nfct) | |||
2057 | if (nfct) | 2064 | if (nfct) |
2058 | atomic_inc(&nfct->use); | 2065 | atomic_inc(&nfct->use); |
2059 | } | 2066 | } |
2067 | #endif | ||
2068 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2060 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) | 2069 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) |
2061 | { | 2070 | { |
2062 | if (skb) | 2071 | if (skb) |
@@ -2085,6 +2094,8 @@ static inline void nf_reset(struct sk_buff *skb) | |||
2085 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2094 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
2086 | nf_conntrack_put(skb->nfct); | 2095 | nf_conntrack_put(skb->nfct); |
2087 | skb->nfct = NULL; | 2096 | skb->nfct = NULL; |
2097 | #endif | ||
2098 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2088 | nf_conntrack_put_reasm(skb->nfct_reasm); | 2099 | nf_conntrack_put_reasm(skb->nfct_reasm); |
2089 | skb->nfct_reasm = NULL; | 2100 | skb->nfct_reasm = NULL; |
2090 | #endif | 2101 | #endif |
@@ -2101,6 +2112,8 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
2101 | dst->nfct = src->nfct; | 2112 | dst->nfct = src->nfct; |
2102 | nf_conntrack_get(src->nfct); | 2113 | nf_conntrack_get(src->nfct); |
2103 | dst->nfctinfo = src->nfctinfo; | 2114 | dst->nfctinfo = src->nfctinfo; |
2115 | #endif | ||
2116 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2104 | dst->nfct_reasm = src->nfct_reasm; | 2117 | dst->nfct_reasm = src->nfct_reasm; |
2105 | nf_conntrack_get_reasm(src->nfct_reasm); | 2118 | nf_conntrack_get_reasm(src->nfct_reasm); |
2106 | #endif | 2119 | #endif |
@@ -2114,6 +2127,8 @@ static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
2114 | { | 2127 | { |
2115 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2128 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
2116 | nf_conntrack_put(dst->nfct); | 2129 | nf_conntrack_put(dst->nfct); |
2130 | #endif | ||
2131 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
2117 | nf_conntrack_put_reasm(dst->nfct_reasm); | 2132 | nf_conntrack_put_reasm(dst->nfct_reasm); |
2118 | #endif | 2133 | #endif |
2119 | #ifdef CONFIG_BRIDGE_NETFILTER | 2134 | #ifdef CONFIG_BRIDGE_NETFILTER |