-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert edge to use a new mainloop #59
Merged
Merged
Conversation
This file contains 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
…factoring into two functions
Nothing in the usual peer_info or n2n_sock_t indicates that a peer is to be connected via TCP - it is all done by a separate connection table. This makes it hard to get status output that shows that a given peer should be reachable via TCP. This patch was an attempt to connect some of the dots, sadly it was not enough. It is probably useful framework, but more still needs to be done. Of most annoyance is that the new TCP test in test_integration_packets.sh is sending and receiving over TCP, but gets a wire sock structure that is still flagged as UDP
… they can easily be merged
Note that this not ideal, and we should use an OS pre-define macro, which may have some type safety in it. But this is another case where Windows did something subtly different to basically everyone else.
Demonstrate that all the features are working by converting the tun fd read to use the new mainloop process.
It also reminds us that this n2nsock structure is used in memcmp operations for some of the hash lookups - which could possibly be optimised in the IPv4 case.
…it may be used on streams that are not reading
A send path that queues via the mainloop still needs to be built.
… so we can skip the null check
This introduces a memcpy() operation on the TCP send path, but the intent is that a packet buffer allocation system will be used in the future that will allow removing that.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #59 +/- ##
==========================================
- Coverage 48.94% 46.81% -2.13%
==========================================
Files 40 41 +1
Lines 6038 7880 +1842
==========================================
+ Hits 2955 3689 +734
- Misses 3083 4191 +1108 ☔ View full report in Codecov by Sentry. |
This was referenced Dec 9, 2024
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.
Refactoring the mainloop to be in one place allows the tracking of file handles and the protocol associated with them better. It also allows multiple sockets to exist for each protocol and will help in the future with allowing IPv4 and IPv6 to co-exist. It also paves the way for adding different activity waiting implementations in the future (eg, kqueue, epoll, WaitForMultipleObjects)
Finally, this refactoring has improved TCP mode on Windows. Limited testing has shown that it appears to work fine.