aboutsummaryrefslogtreecommitdiffstats
path: root/device/uapi.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2020-12-14 13:30:38 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-07 14:49:44 +0100
commit93a4313c3a809afe67f1dc430f544282af2b388c (patch)
tree1e510dfe6494b7c1f3b6ee30815a44451f65a74e /device/uapi.go
parentdevice: increase timeout in tests (diff)
downloadwireguard-go-93a4313c3a809afe67f1dc430f544282af2b388c.tar.xz
wireguard-go-93a4313c3a809afe67f1dc430f544282af2b388c.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>
Diffstat (limited to 'device/uapi.go')
-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