aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2020-12-14 13:30:38 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2020-12-15 18:08:24 +0100
commite950ce7bd2ed1b32519f9877803f1b5b510b13c8 (patch)
tree1e510dfe6494b7c1f3b6ee30815a44451f65a74e
parentdevice: increase timeout in tests (diff)
downloadwireguard-go-e950ce7bd2ed1b32519f9877803f1b5b510b13c8.tar.xz
wireguard-go-e950ce7bd2ed1b32519f9877803f1b5b510b13c8.zip
device: accept any io.Reader in device.IpcSetOperation
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>
-rw-r--r--device/uapi.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/device/uapi.go b/device/uapi.go
index 9f9c9bd..c0e522b 100644
--- a/device/uapi.go
+++ b/device/uapi.go
@@ -107,8 +107,8 @@ func (device *Device) IpcGetOperation(socket *bufio.Writer) error {
return nil
}
-func (device *Device) IpcSetOperation(socket *bufio.Reader) error {
- scanner := bufio.NewScanner(socket)
+func (device *Device) IpcSetOperation(r io.Reader) error {
+ scanner := bufio.NewScanner(r)
logError := device.log.Error
logDebug := device.log.Debug