Created attachment 179653 [details] unified diff to fix the problem When net.inet.tcp.log_debug is set, most new connections report Timestamp not expected. The problem is, this gets reported for the message which starts the connection before the state has decided if Timestamps are expected. A simple fix is to move the reporting logic below the code which sets up the timestamp expectation. This logic is in sys/netinet/tcp_input.c
I can confirm the bug. It is also in FreeBSD head.
A commit references this bug: Author: tuexen Date: Wed Aug 23 14:50:08 UTC 2017 New revision: 322812 URL: https://svnweb.freebsd.org/changeset/base/322812 Log: Avoid TCP log messages which are false positives. The check for timestamps are too early to handle SYN-ACK correctly. So move it down after the corresponing processing has been done. PR: 216832 Obtained from: antonfb@hesiod.org MFC after: 1 week Changes: head/sys/netinet/tcp_input.c
Thanks for reporting the issue and providing the fix. I committed it in https://svnweb.freebsd.org/changeset/base/322812 and will MFC it to stable/10 and stable/11. Best regards Michael
A commit references this bug: Author: tuexen Date: Sat Apr 7 15:10:08 UTC 2018 New revision: 332177 URL: https://svnweb.freebsd.org/changeset/base/332177 Log: MFC r322812: Avoid TCP log messages which are false positives. The check for timestamps are too early to handle SYN-ACK correctly. So move it down after the corresponing processing has been done. MFC r322813: Avoid TCP log messages which are false positives. This is https://svnweb.freebsd.org/changeset/base/322812, just for alternate TCP stacks. PR: 216832 Obtained from: antonfb@hesiod.org Changes: _U stable/11/ stable/11/sys/netinet/tcp_stacks/fastpath.c