tcp: Add listening address to SYN flood message
authorJamie Bainbridge <jamie.bainbridge@gmail.com>
Mon, 14 Nov 2022 01:00:08 +0000 (12:00 +1100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Nov 2022 04:53:43 +0000 (20:53 -0800)
commitd9282e48c6088105a98b98153a707fdbcdbf75b1
tree00dbac9dc36fe9d34d5f9e53383a6caa1cf3d2a3
parentfeba6c6702507008f129037849be24dd3eb2ef2f
tcp: Add listening address to SYN flood message

The SYN flood message prints the listening port number, but with many
processes bound to the same port on different IPs, it's impossible to
tell which socket is the problem.

Add the listen IP address to the SYN flood message.

For IPv6 use "[IP]:port" as per RFC-5952 and to provide ease of
copy-paste to "ss" filters. For IPv4 use "IP:port" to match.

Each protcol's "any" address and a host address now look like:

 Possible SYN flooding on port 0.0.0.0:9001.
 Possible SYN flooding on port 127.0.0.1:9001.
 Possible SYN flooding on port [::]:9001.
 Possible SYN flooding on port [fc00::1]:9001.

Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Link: https://lore.kernel.org/r/4fedab7ce54a389aeadbdc639f6b4f4988e9d2d7.1668386107.git.jamie.bainbridge@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_input.c