linux/net/ipv4
Eric Dumazet a9d99ce28e tcp: fix tcpi_segs_in after connection establishment
If final packet (ACK) of 3WHS is lost, it appears we do not properly
account the following incoming segment into tcpi_segs_in

While we are at it, starts segs_in with one, to count the SYN packet.

We do not yet count number of SYN we received for a request sock, we
might add this someday.

packetdrill script showing proper behavior after fix :

// Tests tcpi_segs_in when 3rd packet (ACK) of 3WHS is lost
0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
   +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
   +0 bind(3, ..., ...) = 0
   +0 listen(3, 1) = 0

   +0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop>
   +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK>
+.020 < P. 1:1001(1000) ack 1 win 32792

   +0 accept(3, ..., ...) = 4

+.000 %{ assert tcpi_segs_in == 2, 'tcpi_segs_in=%d' % tcpi_segs_in }%

Fixes: 2efd055c53 ("tcp: add tcpi_segs_in and tcpi_segs_out to tcp_info")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-07 15:47:13 -05:00
..
netfilter
af_inet.c
ah4.c
arp.c
cipso_ipv4.c
datagram.c
devinet.c rtnl: RTM_GETNETCONF: fix wrong return value 2016-02-19 15:33:46 -05:00
esp4.c
fib_frontend.c
fib_lookup.h
fib_rules.c
fib_semantics.c
fib_trie.c
fou.c
gre_demux.c
gre_offload.c
icmp.c
igmp.c mld, igmp: Fix reserved tailroom calculation 2016-03-03 15:41:07 -05:00
inet_connection_sock.c tcp/dccp: fix another race at listener dismantle 2016-02-18 11:35:51 -05:00
inet_diag.c
inet_fragment.c
inet_hashtables.c
inet_lro.c
inet_timewait_sock.c
inetpeer.c
ip_forward.c
ip_fragment.c
ip_gre.c gre: clear IFF_TX_SKB_SHARING 2016-02-18 14:43:48 -05:00
ip_input.c
ip_options.c
ip_output.c ipv4: only create late gso-skb if skb is already set up with CHECKSUM_PARTIAL 2016-02-24 14:11:34 -05:00
ip_sockglue.c
ip_tunnel_core.c
ip_tunnel.c tunnel: Clear IPCB(skb)->opt before dst_link_failure called 2016-02-23 19:11:56 -05:00
ip_vti.c
ipcomp.c
ipconfig.c
ipip.c
ipmr.c
Kconfig
Makefile
netfilter.c
ping.c
proc.c
protocol.c
raw.c
route.c route: check and remove route cache when we get route 2016-02-18 11:31:36 -05:00
syncookies.c
sysctl_net_ipv4.c
tcp_bic.c
tcp_cdg.c
tcp_cong.c
tcp_cubic.c
tcp_dctcp.c
tcp_diag.c
tcp_fastopen.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: do not set rtt_min to 1 2016-02-16 16:07:13 -05:00
tcp_ipv4.c tcp/dccp: fix another race at listener dismantle 2016-02-18 11:35:51 -05:00
tcp_lp.c
tcp_metrics.c tcp: convert cached rtt from usec to jiffies when feeding initial rto 2016-02-23 18:28:46 -05:00
tcp_minisocks.c tcp: fix tcpi_segs_in after connection establishment 2016-03-07 15:47:13 -05:00
tcp_offload.c
tcp_output.c
tcp_probe.c
tcp_recovery.c
tcp_scalable.c
tcp_timer.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tcp.c tcp: correctly crypto_alloc_hash return check 2016-02-17 22:23:04 -05:00
tunnel4.c
udp_diag.c
udp_impl.h
udp_offload.c
udp_tunnel.c tunnel: Clear IPCB(skb)->opt before dst_link_failure called 2016-02-23 19:11:56 -05:00
udp.c
udplite.c
xfrm4_input.c
xfrm4_mode_beet.c
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c
xfrm4_protocol.c
xfrm4_state.c
xfrm4_tunnel.c