| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Interleaves IpcSetOperations would spell trouble.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
| |
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
|
|
|
| |
Also, a behavior change: Stop treating a blank value as 0.
It's not in the spec.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
| |
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
| |
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
| |
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
|
|
|
|
|
|
| |
Unify the handling of unexpected UAPI errors.
The comment that says "should never happen" is incorrect;
this could happen due to I/O errors. Correct it.
Change error message capitalization for consistency.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal of this change is to make the structure
of IpcSetOperation easier to follow.
IpcSetOperation contains a small state machine:
It starts by configuring the device,
then shifts to configuring one peer at a time.
Having the code all in one giant method obscured that structure.
Split out the parts into helper functions and encapsulate the peer state.
This makes the overall structure more apparent.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
|
|
|
|
|
|
| |
Expand IPCError to contain a wrapped error,
and add a helper to make constructing such errors easier.
Add a defer-based "log on returned error" to IpcSetOperation.
This lets us simplify all of the error return paths.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
|
|
|
|
| |
If device.NewPeer returns a nil error,
then the returned peer is always non-nil.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
|
|
|
|
| |
The code as written will drop any read errors on the floor.
Fix that.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bufio is not required.
strings.Builder is cheaper than bytes.Buffer for constructing strings.
io.Writer is more flexible than io.StringWriter,
and just as cheap (when used with io.WriteString).
Run gofmt.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
|
|
|
|
| |
Co-authored-by: David Anderson <danderson@tailscale.com>
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
|
|
|
|
|
|
| |
Any io.Reader will do, and there are no performance concerns here.
This is technically backwards incompatible,
but it is very unlikely to break any existing code.
It is compatible with the existing uses in wireguard-{windows,android,apple}
and also will allow us to slightly simplify it if desired.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
|
|
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
|
|
|
|
|
|
| |
This makes uapi.go's public API conform to Go style in terms
of error types.
Signed-off-by: David Anderson <danderson@tailscale.com>
|
|
|
|
|
|
|
|
|
|
| |
The sticky socket code stays in the device package for now,
as it reaches deeply into the peer list.
This is the first step in an effort to split some code out of
the very busy device package.
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
|
| |
|
|
|
|
|
|
| |
This enables race-free updates for wg-dynamic and similar tools.
Suggested-by: Thomas Gschwantner <tharre3@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|