Skip to content
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

Router: remove most uses of net.UDPAddr in favor of netip.AddrPort #4526

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

jiceatscion
Copy link
Contributor

This stemmed from an effort at reducing the cost of ResolveLocal, which comes mostly from the net.UDPAddr API causing lots of garbage to collect. In the end that change is a bit viral and many more less costly uses were removed as well.

@matzf
Copy link
Member

matzf commented May 16, 2024

This change is Reviewable

jiceatscion and others added 13 commits May 16, 2024 19:43
(Well... that's the intent anyway).
A pointer being a bit smaller than a net.UDPAddr, there's some
gains in only copying the reference. However, we allocate it only once
and continue updating it in-place. The GC is the real concern here.
Also, found a bug that was revealed by the dispatcher removal changes in the router:
One of the tests sends a raw payload with no SCION/UDP header but was crafting messages that
indicated a SCION/UDP header. Since the dispatcher removal PR, the router snoops in L4 and
mistakes the payload for a UDP header. That is invisible unless the payload is empty.\
No idea why the test doesn't break in master but it brakes in this PR.
We pay the GC price...until my next PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants