Update network interface association/disassociation#2594
Merged
stevenengler merged 5 commits intoshadow:mainfrom Dec 8, 2022
Merged
Update network interface association/disassociation#2594stevenengler merged 5 commits intoshadow:mainfrom
stevenengler merged 5 commits intoshadow:mainfrom
Conversation
ebe74f4 to
ce6b746
Compare
Rustfmt can't process "let else" blocks and this one was difficult to read, so this block was broken up and changed.
Codecov ReportBase: 66.71% // Head: 67.04% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2594 +/- ##
==========================================
+ Coverage 66.71% 67.04% +0.33%
==========================================
Files 197 197
Lines 29133 29161 +28
Branches 5738 5736 -2
==========================================
+ Hits 19435 19550 +115
+ Misses 5162 5064 -98
- Partials 4536 4547 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
ce6b746 to
a1cc39f
Compare
a1cc39f to
350a9c1
Compare
sporksmith
approved these changes
Dec 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The network interface's association and disassociation methods use
compatsocket_getSocketNameandcompatsocket_getPeerNameto get the local ip/port and peer ip/port when generating the key, but this can be confusing and lead to bugs. For example, the calling code needs to make to set the correct addresses usingcompatsocket_setSocketNameandcompatsocket_setPeerNamebefore associating the socket (setting them after would be a bug), and it's not clear that this requirement exists. Some related issues that come up because of this indirection are #2590 and #2592.This PR changes the network interface to take the ip/ports explicitly instead. This also makes the code more flexible, and makes it easier to implement Rust socket objects. It also adds an improvement for #2590 so that UDP sockets are always associated using a peer ip/port of 0/0, which means we shouldn't leak UDP sockets anymore when they use
connect().