From: Florian Westphal Subject: Re: tcp hang when socket fills up ? Date: Mon, 16 Apr 2018 13:01:58 +0200 Message-ID: <20180416110158.2cwr3pi3anpkzrw3@breakpoint.cc> References: <20180406090720.GA31845@nautica> <20180413163254.ucyvnkqpb4psluea@unicorn.suse.cz> <20180414010907.GA11526@nautica> <863dc88d-bc91-d3b6-70c6-5e279451f66d@gmail.com> <20180414015515.GA24798@nautica> <20180416014740.GA12245@nautica> <38b6a690-e01d-471f-ce85-e6e6a8acd26d@gmail.com> <20180416035546.GA5388@nautica> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Eric Dumazet , Michal Kubecek , netdev@vger.kernel.org To: Dominique Martinet Return-path: Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:43682 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754169AbeDPLCD (ORCPT ); Mon, 16 Apr 2018 07:02:03 -0400 Content-Disposition: inline In-Reply-To: <20180416035546.GA5388@nautica> Sender: netdev-owner@vger.kernel.org List-ID: Dominique Martinet wrote: > Eric Dumazet wrote on Sun, Apr 15, 2018: > > Are you sure you do not have some iptables/netfilter stuff ? > > I have a basic firewall setup with default rules e.g. starts with > -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT > in the INPUT chain... > That said, I just dropped it on the server to check and that seems to > workaround the issue?! > When logging everything dropped it appears to decide that the connection > is no longer established at some point, but only if there is > tcp_timestamp, just, err, how? > > And certainly enough, if I restore the firewall while a connection is up > that just hangs; conntrack doesn't consider it connected anymore at some > point (but it worked for a while!) > > Here's the kind of logs I get from iptables: > IN=wlp1s0 OUT= MAC=00:c2:c6:b4:7e:c7:a4:12:42:b5:5d:fc:08:00 SRC=client DST=server LEN=52 TOS=0x00 PREC=0x00 TTL=52 ID=17038 DF PROTO=TCP SPT=41558 DPT=15609 WINDOW=1212 RES=0x00 ACK URGP=0 You could do echo 6 > /proc/sys/net/netfilter/nf_conntrack_log_invalid to have conntrack log when/why it thinks packet is invalid. You can also set echo 1 > /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal which stops conntrack from marking packets with out-of-window acks as invalid. (Earlier email implies this is related to timestamps, but unfortunately to best of my knowledge conntrack doesn't look at tcp timestamps).