All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/1] net: tcp: Don't increase the TCP_MIB_OUTRSTS when fail to transmit RST
@ 2017-04-06 13:35 gfree.wind
  2017-04-06 14:00 ` Neal Cardwell
  0 siblings, 1 reply; 6+ messages in thread
From: gfree.wind @ 2017-04-06 13:35 UTC (permalink / raw)
  To: davem, kuznet, jmorris, kaber, netdev; +Cc: Gao Feng

From: Gao Feng <fgao@ikuai8.com>

When fail to transmit RST, don't increase TCP_MIB_OUTRSTS in func
tcp_send_active_reset like the case that it only increases
LINUX_MIB_TCPABORTFAILED when fail to alloc skb.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 net/ipv4/tcp_output.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 22548b5..274802f 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -3014,8 +3014,8 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority)
 	/* Send it off. */
 	if (tcp_transmit_skb(sk, skb, 0, priority))
 		NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTFAILED);
-
-	TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTRSTS);
+	else
+		TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTRSTS);
 }
 
 /* Send a crossed SYN-ACK during socket establishment.
-- 
1.9.1

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

end of thread, other threads:[~2017-04-06 15:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 13:35 [PATCH net 1/1] net: tcp: Don't increase the TCP_MIB_OUTRSTS when fail to transmit RST gfree.wind
2017-04-06 14:00 ` Neal Cardwell
2017-04-06 14:05   ` Gao Feng
2017-04-06 14:08     ` Neal Cardwell
2017-04-06 15:11       ` Gao Feng
2017-04-06 15:24       ` Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.