|
Bugzilla – Full Text Bug Listing |
| Summary: | TcpSocketImpl doesn’t free endpoint quickly enough after being closed | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Ewgenij Starostin <estar> |
| Component: | internet | Assignee: | George Riley <riley> |
| Status: | RESOLVED FIXED | ||
| Severity: | blocker | CC: | craigdo, jpelkey, mathieu.lacage, riley |
| Priority: | P1 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
patch that attempts to free m_endPoint more quickly
Tests for Bind()/Close() behaviour Linux equivalents of the tests |
||
|
Description
Ewgenij Starostin
2009-04-26 19:59:42 UTC
Created attachment 430 [details]
patch that attempts to free m_endPoint more quickly
+1 Pushed changeset: a41b2894ccce I thought it deserved a tad more comment but pushed essentially intact. changeset: bb360763b0e2 Previous commit seems to have vanished. Looking at it again, this change fixes the problem if the socket changed state between Bind() and Close(), but not if there was no Listen() or similar between those calls. Removing the check for saveState != CLOSED would fix that, but would (probably) cause problems whenever actions occur in the CLOSED state without a state change, e. g. for aT[CLOSED][SYN_RX] = SA (CLOSED, RST_TX); where the socket name shouldn’t be reset. I can’t think of a nice way to fix it; maybe a new action to replace NO_ACT in aT[CLOSED][APP_CLOSE] = SA (CLOSED, NO_ACT); would be the right place to free the endpoint explicitly in this case. Attaching tests for NS3 and Linux to illustrate the difference in behaviour. Created attachment 506 [details]
Tests for Bind()/Close() behaviour
Add two tests to src/internet-stack/tcp-test.cc.
Test4 checks
sock1->Bind(); sock1->Listen(); sock1->Close(); sock2->Bind();
and works at the moment. Test5 checks
sock1->Bind(); sock1->Close(); sock2->Bind();
and fails.
Created attachment 507 [details]
Linux equivalents of the tests
Equivalent (I hope) implementations of both tests for Linux; these ones pass.
changeset c54b36fb7317 |