]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
devlink: Fix incorrect skb socket family dumping
authorLi RongQing <lirongqing@baidu.com>
Tue, 7 Apr 2026 02:27:30 +0000 (22:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Apr 2026 11:30:42 +0000 (13:30 +0200)
[ Upstream commit 0006c6f1091bbeea88b8a88a6548b9fb2f803c74 ]

The devlink_fmsg_dump_skb function was incorrectly using the socket
type (sk->sk_type) instead of the socket family (sk->sk_family)
when filling the "family" field in the fast message dump.

This patch fixes this to properly display the socket family.

Fixes: 3dbfde7f6bc7b8 ("devlink: add devlink_fmsg_dump_skb() function")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260407022730.2393-1-lirongqing@baidu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/devlink/health.c

index 136a67c36a20dd03fe1a103f2e728567b0256598..0798c82096bdc837c7627609528c9b842b4c4c65 100644 (file)
@@ -1327,7 +1327,7 @@ void devlink_fmsg_dump_skb(struct devlink_fmsg *fmsg, const struct sk_buff *skb)
        if (sk) {
                devlink_fmsg_pair_nest_start(fmsg, "sk");
                devlink_fmsg_obj_nest_start(fmsg);
-               devlink_fmsg_put(fmsg, "family", sk->sk_type);
+               devlink_fmsg_put(fmsg, "family", sk->sk_family);
                devlink_fmsg_put(fmsg, "type", sk->sk_type);
                devlink_fmsg_put(fmsg, "proto", sk->sk_protocol);
                devlink_fmsg_obj_nest_end(fmsg);