-
Notifications
You must be signed in to change notification settings - Fork 473
Allow withholding the SYN|ACK packet by user code #1063
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
Conversation
I assume the CI failures are related to outdated versions in the main branch? This PR is at least not modifying any parts of Cargo.toml et, al. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1063 +/- ##
==========================================
- Coverage 81.16% 79.62% -1.54%
==========================================
Files 81 81
Lines 28974 24218 -4756
==========================================
- Hits 23516 19284 -4232
+ Misses 5458 4934 -524 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
My bad, there was already a PR for it in #863. I do understand the argument made there but given that this is more or less already deployed in production systems I think it is worth iterating over it again. |
@Dirbaio How about adding this feature behind a feature flag? |
Yes, I'd prefer it to be gated behind a cargo feature so it doesn't increase code size when you don't need it (yes it's very little code size but for embedded use cases i'll take every byte I can get 😅 ) Also, could you add a test? |
Sure thing! |
probably |
placed it behind a feature flag and added a unit test 🙂 |
What is the current state of this? 🙂 |
Waiting for someone to fix CI. |
It seems to be unrelated to the changes made in the PR though, right? |
Yes, sorry, let me clarify. Your changes are fine. I was hoping that one of the other smoltcp maintainers would fix the CI (hence "someone", as in "not you"), but I might have to do it. |
Actually, do you think you could rebase on top of main? |
Sure |
In certain use cases, it's desirable to not send a SYN|ACK packet immediately after receiving a SYN -- for example, a TCP proxy that doesn't want to do so until it's connected to the end destination, because the outgoing connection might get refused. (Currently, you have to send a SYN|ACK and then reset the connection afterwards in this case.) To fix this, add a simple `synack_paused` flag, controllable by user code, that withholds SYN|ACK packets in `SynReceived` state until it is unset.
rebased. |
Thanks! |
We at The Tor Project, Inc. have been using this trivial patch in a downstream fork of smoltcp for almost 1.5 years. We never bothered to upstream it, because the assumed the feature was too much of a niche one. However, given the recent release of oniux, which uses the downstream fork of smoltcp extensively, we thought it is a good idea to upstream it, given that many distributions already bundle oniux themselves.
In certain use cases, it's desirable to not send a SYN|ACK packet immediately after receiving a SYN -- for example, a TCP proxy that doesn't want to do so until it's connected to the end destination, because the outgoing connection might get refused. (Currently, you have to send a SYN|ACK and then reset the connection afterwards in this case.)
To fix this, add a simple
synack_paused
flag, controllable by user code, that withholds SYN|ACK packets inSynReceived
state until it is unset.