Repository navigation
wgengine/netstack: Allow userspace networking mode to expose subnets - #1588
Merged
Merged
Conversation
Updates #504 Updates #707 Signed-off-by: Naman Sood <[email protected]>
bradfitz
reviewed
Mar 25, 2021
…nections done Signed-off-by: Naman Sood <[email protected]>
Signed-off-by: Naman Sood <[email protected]>
Signed-off-by: Naman Sood <[email protected]>
bradfitz
reviewed
Mar 28, 2021
Signed-off-by: Naman Sood <[email protected]>
bradfitz
reviewed
Mar 29, 2021
Signed-off-by: Naman Sood <[email protected]>
bradfitz
reviewed
Mar 29, 2021
bradfitz
reviewed
Mar 29, 2021
| var isTailscaleIP bool | ||
| reqDetails := r.ID() | ||
| dialAddr := reqDetails.LocalAddress | ||
| dialNetAddr, _ := netaddr.FromStdIP(net.IP(dialAddr)) |
Member
There was a problem hiding this comment.
you want to bail out early if this conversion fails?
Member
Author
There was a problem hiding this comment.
I figured it shouldn't fail, given that we came this far (since there was a similar conversion done for this TCP request at the call of addSubnetAddress).
Signed-off-by: Naman Sood <[email protected]>
bradfitz
approved these changes
Mar 29, 2021
| ns.connsOpenBySubnetIP[ip]++ | ||
| // Only register address into netstack for first concurrent connection. | ||
| if ns.connsOpenBySubnetIP[ip] == 1 { | ||
| ns.ipstack.AddAddress(nicID, pn, tcpip.Address(ip.IPAddr().IP)) |
Member
There was a problem hiding this comment.
probably doesn't matter but this doesn't really need to be done while ns.mu is held.
needAdd := ns.connsOpenBySubnetIP[ip] == 1
ns.mu.Unlock
if needAdd {
ns.ipstack.AddAddress(nicID, pn, tcpip.Address(ip.IPAddr().IP))
}
Member
|
ship it. :) |
Signed-off-by: Naman Sood <[email protected]>
Signed-off-by: Naman Sood <[email protected]>
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.
Updates #504
Updates #707
Signed-off-by: Naman Sood [email protected]