tcp: remove the duplicate prefixes in the logging message
Subsystems (3)
PATCH 1/1 tcp: remove the duplicate prefixes in the logging message
From: Li RongQing <[email protected]>
The current message is:
TCP: TCP: Possible SYN flooding on port 80. Sending cookies. ...
The cause is that pr_info will implicitly print the pr_fmt string, which is standard prefix, and explicitly print the "proto" which is "TCP:" too
it is unsuitable to not print proto, since proto maybe TCPv6, so use printk directly.
--- net/ipv4/tcp_ipv4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_ipv4.c +2 -2
@@ -892,8 +892,8 @@ bool tcp_syn_flood_action(struct sock *sk, lopt =inet_csk (sk)->icsk_accept_queue.listen_opt;if (!lopt->synflood_warned && sysctl_tcp_syncookies !=2 ) { lopt->synflood_warned =1 ; -pr_info ("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n" , - proto,ntohs (tcp_hdr (skb)->dest), msg); +printk (KERN_INFO "%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n" , + proto,ntohs (tcp_hdr (skb)->dest), msg); }return want_cookie; }
Signature · 1 line
1.7.10.4
Quoted 9 lines · On 04/23/2014 11:28 AM, [email protected] wrote:
From: Li RongQing <[email protected]>
The current message is:
TCP: TCP: Possible SYN flooding on port 80. Sending cookies. ...The cause is that
pr_infowill implicitly print thepr_fmtstring, which is standard prefix, and explicitly print the "proto" which is "TCP:" tooit is unsuitable to not print proto, since proto maybe TCPv6, so use printk directly.
Can't you just leave the pr_info() instead, and reword that into something like:
"Possible %s SYN flooding[...]", proto
Quoted 22 lines
Cc Joe Perches <[email protected]>Signed-off-by Li RongQing <[email protected]>--- net/ipv4/tcp_ipv4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)net/ipv4/tcp_ipv4.c +2
-2@@ -892,8 +892,8 @@ bool tcp_syn_flood_action(struct sock *sk, lopt =inet_csk (sk)->icsk_accept_queue.listen_opt;if (!lopt->synflood_warned && sysctl_tcp_syncookies !=2 ) { lopt->synflood_warned =1 ; -pr_info ("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n" , - proto,ntohs (tcp_hdr (skb)->dest), msg); +printk (KERN_INFO "%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n" , + proto,ntohs (tcp_hdr (skb)->dest), msg); }return want_cookie; }
Quoted 11 lines · Daniel Borkmann
Quoted 10 lines · On 04/23/2014 11:28 AM, [email protected] wrote:
From: Li RongQing <[email protected]>
The current message is:
TCP: TCP: Possible SYN flooding on port 80. Sending cookies. ...The cause is that
pr_infowill implicitly print thepr_fmtstring, which is standard
prefix, and explicitly print the "proto" which is "TCP:" too
Quoted 8 lines
Quoted 2 lines
it is unsuitable to not print proto, since proto maybe TCPv6, so use printk directly.
Can't you just leave the
pr_info()instead, and reword that into something like:"Possible %s SYN flooding[...]", proto
To ipv4:
TCP: Possible TCP SYN flooding on port 80. Sending cookies. ...
To ipv6:
TCP: Possible TCPv6 SYN flooding on port 80. Sending cookies. ...
I think there are two "TCP" still, and it is duplicate;
-Roy
David Miller
maintainerFrom: Li RongQing <[email protected]>
Date: Wed, 23 Apr 2014 21:32:43 +0800
Quoted 22 lines · Daniel Borkmann
Quoted 11 lines · On 04/23/2014 11:28 AM, [email protected] wrote:
Quoted 10 lines
From: Li RongQing <[email protected]>
The current message is:
TCP: TCP: Possible SYN flooding on port 80. Sending cookies. ...The cause is that
pr_infowill implicitly print thepr_fmtstring, which is standard
prefix, and explicitly print the "proto" which is "TCP:" tooQuoted 8 lines
Quoted 2 lines
it is unsuitable to not print proto, since proto maybe TCPv6, so use printk directly.
Can't you just leave the
pr_info()instead, and reword that into something like:"Possible %s SYN flooding[...]", proto
To ipv4:
Quoted 8 lines
TCP: Possible TCP SYN flooding on port 80. Sending cookies. ...
To ipv6:
TCP: Possible TCPv6 SYN flooding on port 80. Sending cookies. ...
I think there are two "TCP" still, and it is duplicate;
Just kill the proto string altogether, I don't think it doesn't adds anything.