Re: [PATCH] tcp: Add listening address to SYN flood message

From: Eric Dumazet
Date: Thu Nov 10 2022 - 18:46:25 EST


On Thu, Nov 10, 2022 at 3:39 PM Stephen Hemminger
<stephen@xxxxxxxxxxxxxxxxxx> wrote:
>
> On Thu, 10 Nov 2022 21:21:06 +1100
> Jamie Bainbridge <jamie.bainbridge@xxxxxxxxx> wrote:
>
> > + xchg(&queue->synflood_warned, 1) == 0) {
> > +#if IS_ENABLED(CONFIG_IPV6)
> > + if (sk->sk_family == AF_INET6) {
> > + net_info_ratelimited("%s: Possible SYN flooding on port %d. IP %pI6c. %s. Check SNMP counters.\n",
> > + proto, sk->sk_num,
> > + &sk->sk_v6_rcv_saddr, msg);
> > + } else
> > +#endif
> > + {
> > + net_info_ratelimited("%s: Possible SYN flooding on port %d. IP %pI4. %s. Check SNMP counters.\n",
> > + proto, sk->sk_num, &sk->sk_rcv_saddr, msg);
> > + }
> > + }
> >
>
> Port number is unsigned not signed.
> Message also seems overly wordy to me.

Also, it is customary to use IP.port format (like most tools, see tcpdump)