Don't kill IPv4 sockets when killing IPv6 sockets was requested.
authorLorenzo Colitti <lorenzo@google.com>
Wed, 28 Oct 2015 06:56:59 +0000 (15:56 +0900)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:51:44 +0000 (13:51 -0800)
commit8bf4413b4f54e24120b90ecbfee426beeddc3ff0
tree10577131f8c2c390ac6ae10ba4025bfd66704a11
parentdcc8ef44353408913246228dc5f9b933d19c353a
Don't kill IPv4 sockets when killing IPv6 sockets was requested.

c7c3ec4903d32c60423ee013d96e94602f66042c cherry-picked the
tcp_nuke_addr ioctl, but omitted a check that ensures that a
socket is an IPv6 socket. This makes it so that if we issue a
SIOCKILLADDR on ::, it kills IPv4 sockets as well.

This is because every IPv4 socket has an IPv6 source address
(sk_v6_rcv_saddr) of ::. Thus, when we iterate over an IPv4
socket, and compare the source address of the socket to the
source address in the ioctl, it matches the :: that was passed
in, and we kill the socket.

Change-Id: I736431a898e6ec91536536d352936a210aa10100
net/ipv4/tcp.c