]> git.proxmox.com Git - mirror_iproute2.git/commit
ss: prepare rth when killing inet sock
authorMasatake YAMATO <yamato@redhat.com>
Thu, 15 Feb 2018 19:11:20 +0000 (04:11 +0900)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 23 Feb 2018 16:32:39 +0000 (08:32 -0800)
commit97352f1b334f3dc73882e387e2fcaf6e3342e41b
tree4c733ff0a71fc859e27a1bb615228be7ecb7a9e0
parenta883dd8b063699deaadfc9f0dae30cf53c0f1885
ss: prepare rth when killing inet sock

kill_inet_sock() expects rhn_handle instance is passed
via inet_diag_arg argument. However on the following calling path:

    generic_show_sock
    => show_one_inet_sock
       => kill_inet_sock

rth field of inet_diag_arg is not filled with the address of
rhn_handle instance. As the result ss crashes.

This commit fills the field with newly created rhn_handle
instance.

Changes in v2:
Instead of creating rtn_handle instances for each socket, create
one in upper layer and reuse it.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
misc/ss.c