]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 7 Apr 2020 08:51:51 +0000 (10:51 +0200)
commitdcffbacb906bd7c98da05fd2562843089ced0e00
treeae62b89125ffc0c2cd180f7ed36ba7f6ceec1bed
parent2cef24357f3686530147a374cf56ce8b94e85cfe
inet_diag: return classid for all socket types

BugLink: https://bugs.launchpad.net/bugs/1869732
[ Upstream commit 83f73c5bb7b9a9135173f0ba2b1aa00c06664ff9 ]

In commit 1ec17dbd90f8 ("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: 1ec17dbd90f8 ("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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
include/linux/inet_diag.h
net/ipv4/inet_diag.c
net/ipv4/raw_diag.c
net/ipv4/udp_diag.c
net/sctp/sctp_diag.c