@@ -17,7 +17,7 @@
MODULE_PARM_DESC(raw_before_defrag, "Enable raw table before defrag");
module_param(raw_before_defrag, bool, 0000);
-static struct xt_table packet_raw = {
+static struct xt_table packet_raw __refdata = {
.name = "raw",
.valid_hooks = RAW_VALID_HOOKS,
.me = THIS_MODULE,
@@ -78,9 +78,13 @@ static unsigned int ipv4_conntrack_defrag(void *priv,
if (skb_nfct(skb) && !nf_ct_is_template((struct nf_conn *)skb_nfct(skb)))
return NF_ACCEPT;
#endif
+
+ if (skb->_nfct == IP_CT_UNTRACKED)
+ return NF_ACCEPT;
#endif
+
/* Gather fragments. */
- if (skb->_nfct != IP_CT_UNTRACKED && ip_is_fragment(ip_hdr(skb))) {
+ if (ip_is_fragment(ip_hdr(skb))) {
enum ip_defrag_users user =
nf_ct_defrag_user(state->hook, skb);
@@ -16,7 +16,7 @@
MODULE_PARM_DESC(raw_before_defrag, "Enable raw table before defrag");
module_param(raw_before_defrag, bool, 0000);
-static struct xt_table packet_raw = {
+static struct xt_table packet_raw __refdata = {
.name = "raw",
.valid_hooks = RAW_VALID_HOOKS,
.me = THIS_MODULE,
@@ -63,10 +63,10 @@ static unsigned int ipv6_defrag(void *priv,
/* Previously seen (loopback)? */
if (skb_nfct(skb) && !nf_ct_is_template((struct nf_conn *)skb_nfct(skb)))
return NF_ACCEPT;
-#endif
if (skb->_nfct == IP_CT_UNTRACKED)
return NF_ACCEPT;
+#endif
err = nf_ct_frag6_gather(state->net, skb,
nf_ct6_defrag_user(state->hook, skb));
Since packet_raw is now no longer const and referenced in __init, make it __refdata. Also, reference conntrack state only if conntrack is enabled. These are fixes for errors reported by kbuild test robot. Fixes: 902d6a4c2a4f411 ("netfilter: nf_defrag: Skip defrag if NOTRACK is set") Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> --- net/ipv4/netfilter/iptable_raw.c | 2 +- net/ipv4/netfilter/nf_defrag_ipv4.c | 6 +++++- net/ipv6/netfilter/ip6table_raw.c | 2 +- net/ipv6/netfilter/nf_defrag_ipv6_hooks.c | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)