netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][net-next] tcp: remove the duplicate prefixes in the logging message
@ 2014-04-21 13:17 roy.qing.li
  2014-04-22  0:04 ` Li RongQing
  0 siblings, 1 reply; 6+ messages in thread
From: roy.qing.li @ 2014-04-21 13:17 UTC (permalink / raw)
  To: netdev; +Cc: joe

From: Li RongQing <roy.qing.li@gmail.com>

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.

Cc: Joe Perches <joe@perches.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/ipv4/tcp_ipv4.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 6379894..370fa46 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -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;
 }
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH][net-next] tcp: remove the duplicate prefixes in the logging message
  2014-04-21 13:17 [PATCH][net-next] tcp: remove the duplicate prefixes in the logging message roy.qing.li
@ 2014-04-22  0:04 ` Li RongQing
  0 siblings, 0 replies; 6+ messages in thread
From: Li RongQing @ 2014-04-22  0:04 UTC (permalink / raw)
  To: netdev; +Cc: joe

On Mon, Apr 21, 2014 at 9:17 PM,  <roy.qing.li@gmail.com> wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>

Sorry, Please drop it, there is a build failure.

-Roy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH][net-next] tcp: remove the duplicate prefixes in the logging message
@ 2014-04-23  9:28 roy.qing.li
  2014-04-23  9:35 ` Daniel Borkmann
  0 siblings, 1 reply; 6+ messages in thread
From: roy.qing.li @ 2014-04-23  9:28 UTC (permalink / raw)
  To: netdev; +Cc: joe

From: Li RongQing <roy.qing.li@gmail.com>

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.

Cc: Joe Perches <joe@perches.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/ipv4/tcp_ipv4.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 438f3b9..85ebe68 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -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;
 }
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH][net-next] tcp: remove the duplicate prefixes in the logging message
  2014-04-23  9:28 roy.qing.li
@ 2014-04-23  9:35 ` Daniel Borkmann
  2014-04-23 13:32   ` Li RongQing
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Borkmann @ 2014-04-23  9:35 UTC (permalink / raw)
  To: roy.qing.li; +Cc: netdev, joe

On 04/23/2014 11:28 AM, roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>
> 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.

Can't you just leave the pr_info() instead, and reword that into something like:

   "Possible %s SYN flooding[...]", proto

> Cc: Joe Perches <joe@perches.com>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
>   net/ipv4/tcp_ipv4.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 438f3b9..85ebe68 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -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;
>   }
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][net-next] tcp: remove the duplicate prefixes in the logging message
  2014-04-23  9:35 ` Daniel Borkmann
@ 2014-04-23 13:32   ` Li RongQing
  2014-04-24 17:26     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Li RongQing @ 2014-04-23 13:32 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: netdev, joe

On Wed, Apr 23, 2014 at 5:35 PM, Daniel Borkmann <dborkman@redhat.com> wrote:
> On 04/23/2014 11:28 AM, roy.qing.li@gmail.com wrote:
>>
>> From: Li RongQing <roy.qing.li@gmail.com>
>>
>> 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.
>
>
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][net-next] tcp: remove the duplicate prefixes in the logging message
  2014-04-23 13:32   ` Li RongQing
@ 2014-04-24 17:26     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-04-24 17:26 UTC (permalink / raw)
  To: roy.qing.li; +Cc: dborkman, netdev, joe

From: Li RongQing <roy.qing.li@gmail.com>
Date: Wed, 23 Apr 2014 21:32:43 +0800

> On Wed, Apr 23, 2014 at 5:35 PM, Daniel Borkmann <dborkman@redhat.com> wrote:
>> On 04/23/2014 11:28 AM, roy.qing.li@gmail.com wrote:
>>>
>>> From: Li RongQing <roy.qing.li@gmail.com>
>>>
>>> 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.
>>
>>
>> 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;

Just kill the proto string altogether, I don't think it doesn't adds
anything.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-24 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-21 13:17 [PATCH][net-next] tcp: remove the duplicate prefixes in the logging message roy.qing.li
2014-04-22  0:04 ` Li RongQing
  -- strict thread matches above, loose matches on Subject: below --
2014-04-23  9:28 roy.qing.li
2014-04-23  9:35 ` Daniel Borkmann
2014-04-23 13:32   ` Li RongQing
2014-04-24 17:26     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).