]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
device: accept any io.Reader in device.IpcSetOperation
authorJosh Bleecher Snyder <josh@tailscale.com>
Mon, 14 Dec 2020 21:30:38 +0000 (13:30 -0800)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 15 Dec 2020 17:08:24 +0000 (18:08 +0100)
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>
device/uapi.go

index 9f9c9bd3803b80f35a323d7c04c33870958f1599..c0e522b16abdedec2bf58ce5c8fc38e1acc064d1 100644 (file)
@@ -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(io.Reader) error {
+       scanner := bufio.NewScanner(r)
        logError := device.log.Error
        logDebug := device.log.Debug