Commit 1fcf5722 authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski
Browse files

net: allow skb_release_head_state() to be called multiple times



Currently, only skb dst is cleared (thanks to skb_dst_drop())

Make sure skb->destructor, conntrack and extensions are cleared.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20251106202935.1776179-2-edumazet@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent fd9557c3
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1149,11 +1149,10 @@ void skb_release_head_state(struct sk_buff *skb)
				skb);

#endif
		skb->destructor = NULL;
	}
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
	nf_conntrack_put(skb_nfct(skb));
#endif
	skb_ext_put(skb);
	nf_reset_ct(skb);
	skb_ext_reset(skb);
}

/* Free everything but the sk_buff shell. */