lwIP - A Lightweight TCP/IP stack - Bugs: bug #52403, netconn: FIN may be sent instead...
You are not allowed to post comments on this tracker with your current authentication level.
bug #52403: netconn: FIN may be sent instead of RST when TCP netconn is closed with pending data in recv_mbox
Submitter: | Gao Qingshui <kevingao> | ||
Submitted: | Tue 14 Nov 2017 12:59:56 PM UTC | ||
Category: | sockets/netconn | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Fixed |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | 2.1.0 |
lwIP version: | git head |
Jump to the original submission
Mon 20 Nov 2017 09:21:51 AM UTC, comment #8: |
Simon Goldschmidt <goldsimon> |
Mon 20 Nov 2017 07:03:28 AM UTC, comment #7: Simon,there are two cases for TCP socket which would make 'lastdata' was not NULL. 1st, the MSG_PEEK recv/recvfrom operation mentioned previously; 2nd, normal recv/recvfrom, but the user buffer was shorter than the data length of first segment in recvmbox. I tested on version 1.4.1 and 2.0.3 and found both have this issue. So what is the 'new code' in your comments? |
Gao Qingshui <kevingao> |
Sat 18 Nov 2017 12:37:15 PM UTC, comment #6: Fixed 1) in tcp_close_shutdown(), this was indeed wrong.
|
Simon Goldschmidt <goldsimon> |
Thu 16 Nov 2017 02:36:04 AM UTC, comment #5: Simon, after deleting the tcp_recved calling in netconn_drain, RESET segment was sent instead of FIN segment, so the problem discussed previously was fixed. But there was also two minor problems need to be noticed:
|
Gao Qingshui <kevingao> |
Wed 15 Nov 2017 08:13:02 PM UTC, comment #4: And pushed a fix. Thanks for reporting. Please report back here if my change doesn't fix it for you. |
Simon Goldschmidt <goldsimon> |
Wed 15 Nov 2017 08:11:56 PM UTC, comment #3: OK, so the short version is that in your specific situation, a FIN was sent instead of a RST because netconn_drain calls tcp_recved, which it probably shouldn't?
|
Simon Goldschmidt <goldsimon> |
Wed 15 Nov 2017 08:47:08 AM UTC, comment #2: Hi Simon, no code changes was made in socket/netconn/tcp layer. I just made OS adaption to make lwIP running on my platform.
|
Gao Qingshui <kevingao> |
Tue 14 Nov 2017 06:34:17 PM UTC, comment #1:
|
Simon Goldschmidt <goldsimon> |
Tue 14 Nov 2017 12:59:56 PM UTC, original submission:
Per RFC2525 section 2.17, one TCP RESET segment should be sent if there was pending data not recved by user. But testing result show that lwIP send FIN segment, not RESET segment.
|
Gao Qingshui <kevingao> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 9 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2017-11-18 | goldsimon | Open/Closed | Open | Closed | |
2017-11-17 | goldsimon | Planned Release | None | 2.1.0 | |
2017-11-16 | goldsimon | Open/Closed | Closed | Open | |
2017-11-15 | goldsimon | Category | TCP | sockets/netconn | |
2017-11-15 | goldsimon | Status | Confirmed | Fixed | |
Open/Closed | Open | Closed | |||
2017-11-15 | goldsimon | Status | None | Confirmed | |
Assigned to | None | goldsimon | |||
Summary | lwIP TCP implementation violate RFC2525 section 2.17 | netconn: FIN may be sent instead of RST when TCP netconn is closed with pending data in recv_mbox |
Powered by Savane 3.13-4448.
Corresponding source code
I'm talking about the code in git master. There have been numerous changes since 2.0.0. All 2.0.x releases were bugfix releases only (branching off 2.0.0). We're currently working towards 2.1.0.