]> 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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Mar 2020 04:57:48 +0000 (21:57 -0700)
commit0e2589df62bd9da34e253f3abd1636cfb176843c
tree39c21636cd4bb6e1b44bab7034c030d9c3705195
parentfd0656e64b6d3a3984cedbdf35a950d0b3ae3756
inet_diag: return classid for all socket types

In commit 22bc77361fc7 ("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: 22bc77361fc7 ("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>
include/linux/inet_diag.h
net/ipv4/inet_diag.c
net/ipv4/raw_diag.c
net/ipv4/udp_diag.c
net/sctp/diag.c