]> git.baikalelectronics.ru Git - kernel.git/commit
inet_diag: return classid for all socket types
authorDmitry Yakunin <zeil@yandex-team.ru>
Thu, 5 Mar 2020 12:33:12 +0000 (15:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:17:38 +0000 (07:17 +0100)
commite0add6eded484ab5a991a6c62c1ea7a2be60941d
tree780626871b9214ac390308087395cded856cb5a8
parentd6e15ab99ea54dc47d9561597dbf69ce1935de4d
inet_diag: return classid for all socket types

[ Upstream commit fd5b8a8cdb810c7a5a0f6442b0ff01e3b58de8e7 ]

In commit fd99f91bcd57 ("inet_diag: fix reporting cgroup classid and
fallback to priority") croup classid reporting was fixed. But this works
only for TCP sockets because for other socket types icsk parameter can
be NULL and classid code path is skipped. This change moves classid
handling to inet_diag_msg_attrs_fill() function.

Also inet_diag_msg_attrs_size() helper was added and addends in
nlmsg_new() were reordered to save order from inet_sk_diag_fill().

Fixes: fd99f91bcd57 ("inet_diag: fix reporting cgroup classid and fallback to priority")
Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
Reviewed-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/inet_diag.h
net/ipv4/inet_diag.c
net/ipv4/raw_diag.c
net/ipv4/udp_diag.c
net/sctp/diag.c