Bug 216832

Summary: net.inet.tcp.log_debug incorrect debug message
Product: Base System Reporter: antonfb
Component: kernAssignee: Michael Tuexen <tuexen>
Status: Closed FIXED    
Severity: Affects Only Me CC: jones, smh, tuexen
Priority: --- Keywords: patch
Version: 10.3-RELEASEFlags: tuexen: mfc-stable11?
tuexen: mfc-stable10?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
unified diff to fix the problem none

Description antonfb 2017-02-05 19:29:13 UTC
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
Comment 1 Michael Tuexen freebsd_committer freebsd_triage 2017-08-23 09:17:42 UTC
I can confirm the bug. It is also in FreeBSD head.
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-08-23 14:50:52 UTC
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
Comment 3 Michael Tuexen freebsd_committer freebsd_triage 2017-08-23 14:53:53 UTC
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
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-04-07 15:11:07 UTC
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