-
Notifications
You must be signed in to change notification settings - Fork 28
device: add API for on-demand configuration of peers #47
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
Depends on tailscale/wireguard-go#47 Updates #17858 Change-Id: I3e38484bfc3e73b29cbe9e53f28f140c2cf85ae1 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
| peer.SendHandshakeInitiation(false) | ||
| } | ||
|
|
||
| func expiredZeroKeyMaterial(peer *Peer) { |
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.
we should rename this "expirePeer" or similar
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.
well, I was trying to keep it closer to upstream
device/peer.go
Outdated
| if slices.Equal(p.state.allowedIPs, allowedIPs) { | ||
| return | ||
| } | ||
| p.device.allowedips.SetPeerPrefixes(p, allowedIPs) |
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.
the clone and comment below seem sensible, but if that implies a dependence or leads to a future dependence, SetPeerPrefixes doesn't document the same behavior that this method relies on - if we need to preserve the behavior we should document it so future changes are less likely to accidentally change the semnatics.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
raggi
left a comment
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.
LGTM!
device/device.go
Outdated
| // | ||
| // If the peer does not exist and a [PeerLookupFunc] is set (via | ||
| // [Device.SetPeerLookupFunc]), then that function is used to create the peer | ||
| // before returning it. Peers created via this mechanism exist only their state |
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.
only their
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.
added missing word "until"
Updates tailscale/tailscale#17858 Signed-off-by: Brad Fitzpatrick <brad@danga.com>
| return size | ||
| } | ||
|
|
||
| // LookupPeer looks up a peer by its public key. |
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.
Nonblocking API note: Rather than LookupPeer having a side-effect and LookupActivePeer skipping that side-effect, I'd have expected LookupPeer to have no side-effects and LookupOrCreatePeer (or something like that) to have the side-effect.
But if that causes too much churn for other code, I guess this is probably fine too.
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.
Agreed, but I'm trying to minimize API differences for now with the rest of wireguard-go & upstream.
But I'd be happy to rename these in the future during upstreaming.
This comment was marked as off-topic.
This comment was marked as off-topic.
Depends on tailscale/wireguard-go#47 Updates #17858 Change-Id: I3e38484bfc3e73b29cbe9e53f28f140c2cf85ae1 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Depends on tailscale/wireguard-go#47 Updates #17858 Change-Id: I3e38484bfc3e73b29cbe9e53f28f140c2cf85ae1 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Updates tailscale/tailscale#17858