Bug 250357 - [tcp] RFC 5961 is not implemented completely
Summary: [tcp] RFC 5961 is not implemented completely
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Some People
Assignee: Michael Tuexen
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2020-10-15 03:49 UTC by Yong-Hao Zou
Modified: 2020-10-18 10:36 UTC (History)
3 users (show)

See Also:


Attachments
dmesg.boot (18.70 KB, text/plain)
2020-10-16 02:56 UTC, Yong-Hao Zou
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yong-Hao Zou 2020-10-15 03:49:32 UTC
It seems that RFC 5961 is not implemented completely, the following packetdrill script cannot get a same result as Linux.

```
0  socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0

+0 < S 0:0(0) win 12336 <TS val 100 ecr 0,eol,mss 14705,eol>
+0 ~ +1  > S. 0:0(0) ack 1 <...>

+.1 < . 1:1(0) ack 1 win 32792 <mss 1000,sackOK,nop,wscale 7, nop, nop>
+0.2 accept(3, ..., ...) = 4
+0 fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0

+0 < . 1:2833(2832) ack 1 win 25726 
+0 < . 1:7999(7998) ack 1 win 25198 
+0 < . 7999:13219(5220) ack 1 win 13129 
+0 < . 7999:8760(761) ack 1 win 30256 
+0 < . 8760:14656(5896) ack 892600372 win 36462 
+0.1 read(4, ..., 20000) =  13218

+0 < . 8760:9769(1009) ack 1 win 14709 <sackOK,eol,eol>
+0 < . 9769:17706(7937) ack 1 win 30540 <nop,eol,eol,eol>
+0.1 read(4, ..., 20000) =  4487

+0 < . 17706:26874(9168) ack 2560098456 win 28277 
// f-stack got 9168
+0.1 read(4, ..., 20000) =  -1
```
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-10-16 01:35:29 UTC
@Reporter Can you please provide additional information:

- What is the expected behaviour and what is the actual/current behaviour?
- What FreeBSD version? (uname -a output)
- /var/run/dmesg.boot output (as an attachment)
Comment 2 Yong-Hao Zou 2020-10-16 02:56:57 UTC
Created attachment 218783 [details]
dmesg.boot
Comment 3 Yong-Hao Zou 2020-10-16 02:57:17 UTC
(In reply to Kubilay Kocak from comment #1)

1. The last "read" in the script should return -1 because the ack value of the packet before this read is out of range, but currently FreeBSD accept this packet and the read return 9168.

2. FreeBSD freebsd 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64

3. see attachment