sock_diag: do not broadcast raw socket destruction
commitc369d2d6e7cda5e53d1b06ebfc2bc3921f0472a4
authorWillem de Bruijn <willemb@google.com>
Fri, 24 Jun 2016 20:02:35 +0000 (24 16:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Jul 2016 16:30:00 +0000 (11 09:30 -0700)
tree6f7340a6795350a5026af5b285e026fa41c4f99d
parentaaa7fa15086cc4332c73d5ecf7fa1ab71c8e4ae9
sock_diag: do not broadcast raw socket destruction

[ Upstream commit 9a0fee2b552b1235fb1706ae1fc664ae74573be8 ]

Diag intends to broadcast tcp_sk and udp_sk socket destruction.
Testing sk->sk_protocol for IPPROTO_TCP/IPPROTO_UDP alone is not
sufficient for this. Raw sockets can have the same type.

Add a test for sk->sk_type.

Fixes: eb4cb008529c ("sock_diag: define destruction multicast groups")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/sock_diag.h