-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
net/tstun: use gaissmai/bart instead of tempfork/device #11488
Conversation
a85bb8b
to
fca027e
Compare
6affc07
to
44dbfb6
Compare
net/tstun/wrap.go
Outdated
count[v]++ | ||
return true | ||
}) | ||
// count := map[netip.Addr]int{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not have commented out code here. This was to get the build passing in the patch 😅
We can track the counts when building the table and then just use the value directly here
net/tstun/wrap.go
Outdated
} | ||
if len(listenAddrs) == 0 && len(dstMasqAddrs) == 0 { | ||
if len(listenAddrs) == 0 && needMasq { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!needMasq
net/tstun/wrap.go
Outdated
rt.InsertOrReplace(p.PublicKey, p.AllowedIPs...) | ||
mak.Set(&dstMasqAddrs, p.PublicKey, addrToUse) | ||
for _, ip := range p.AllowedIPs { | ||
needMasq = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably do this outside the allowed ips loops
44dbfb6
to
8d68c40
Compare
This implementation uses less memory than tempfork/device, which helps avoid OOM conditions in the iOS VPN extension when switching to a Tailnet with ExitNode routing enabled. Updates tailscale/corp#18514 Signed-off-by: Percy Wegmann <percy@tailscale.com>
8d68c40
to
236c8b3
Compare
@maisem I've addressed your latest comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks for the review @maisem ! |
This implementation uses less memory than tempfork/device, which helps avoid OOM conditions in the iOS VPN extension when switching to a Tailnet with ExitNode routing enabled.
Updates tailscale/corp#18514