diff options
-rw-r--r-- | net/ipv4/netfilter/nf_defrag_ipv4.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c index 0e5591c2ee9f..6fb869f646bf 100644 --- a/net/ipv4/netfilter/nf_defrag_ipv4.c +++ b/net/ipv4/netfilter/nf_defrag_ipv4.c | |||
@@ -67,10 +67,9 @@ static unsigned int ipv4_conntrack_defrag(void *priv, | |||
67 | const struct nf_hook_state *state) | 67 | const struct nf_hook_state *state) |
68 | { | 68 | { |
69 | struct sock *sk = skb->sk; | 69 | struct sock *sk = skb->sk; |
70 | struct inet_sock *inet = inet_sk(skb->sk); | ||
71 | 70 | ||
72 | if (sk && (sk->sk_family == PF_INET) && | 71 | if (sk && sk_fullsock(sk) && (sk->sk_family == PF_INET) && |
73 | inet->nodefrag) | 72 | inet_sk(sk)->nodefrag) |
74 | return NF_ACCEPT; | 73 | return NF_ACCEPT; |
75 | 74 | ||
76 | #if IS_ENABLED(CONFIG_NF_CONNTRACK) | 75 | #if IS_ENABLED(CONFIG_NF_CONNTRACK) |