]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
uapi: Simpler function signature
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 23 Jan 2019 21:05:07 +0000 (22:05 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 5 Feb 2019 11:59:42 +0000 (12:59 +0100)
uapi.go

diff --git a/uapi.go b/uapi.go
index f5409892d3dc1d537e83fceb170a936fb50d6b84..4a370b3acb3119db075d330ac7fa82c2688f84d6 100644 (file)
--- a/uapi.go
+++ b/uapi.go
@@ -28,7 +28,7 @@ func (s *IPCError) ErrorCode() int64 {
        return s.int64
 }
 
-func ipcGetOperation(device *Device, socket *bufio.ReadWriter) *IPCError {
+func ipcGetOperation(device *Device, socket *bufio.Writer) *IPCError {
 
        device.log.Debug.Println("UAPI: Processing get operation")
 
@@ -108,7 +108,7 @@ func ipcGetOperation(device *Device, socket *bufio.ReadWriter) *IPCError {
        return nil
 }
 
-func ipcSetOperation(device *Device, socket *bufio.ReadWriter) *IPCError {
+func ipcSetOperation(device *Device, socket *bufio.Reader) *IPCError {
        scanner := bufio.NewScanner(socket)
        logError := device.log.Error
        logDebug := device.log.Debug
@@ -403,11 +403,11 @@ func ipcHandle(device *Device, socket net.Conn) {
        switch op {
        case "set=1\n":
                device.log.Debug.Println("UAPI: Set operation")
-               status = ipcSetOperation(device, buffered)
+               status = ipcSetOperation(device, buffered.Reader)
 
        case "get=1\n":
                device.log.Debug.Println("UAPI: Get operation")
-               status = ipcGetOperation(device, buffered)
+               status = ipcGetOperation(device, buffered.Writer)
 
        default:
                device.log.Error.Println("Invalid UAPI operation:", op)