WireGuardKitGo: update to latest wireguard-go tag
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -56,7 +56,6 @@ var tunnelHandles = make(map[int32]tunnelHandle)
|
||||
|
||||
func init() {
|
||||
versionString = C.CString(device.WireGuardGoVersion)
|
||||
device.RoamingDisabled = true
|
||||
signals := make(chan os.Signal)
|
||||
signal.Notify(signals, unix.SIGUSR2)
|
||||
go func() {
|
||||
@@ -74,11 +73,6 @@ func init() {
|
||||
}()
|
||||
}
|
||||
|
||||
//export wgEnableRoaming
|
||||
func wgEnableRoaming(enabled bool) {
|
||||
device.RoamingDisabled = !enabled
|
||||
}
|
||||
|
||||
//export wgSetLogger
|
||||
func wgSetLogger(context, loggerFn uintptr) {
|
||||
loggerCtx = unsafe.Pointer(context)
|
||||
@@ -149,14 +143,17 @@ func wgTurnOff(tunnelHandle int32) {
|
||||
|
||||
//export wgSetConfig
|
||||
func wgSetConfig(tunnelHandle int32, settings *C.char) int64 {
|
||||
device, ok := tunnelHandles[tunnelHandle]
|
||||
dev, ok := tunnelHandles[tunnelHandle]
|
||||
if !ok {
|
||||
return 0
|
||||
}
|
||||
err := device.IpcSetOperation(bufio.NewReader(strings.NewReader(C.GoString(settings))))
|
||||
err := dev.IpcSetOperation(bufio.NewReader(strings.NewReader(C.GoString(settings))))
|
||||
if err != nil {
|
||||
device.Error.Println(err)
|
||||
return err.ErrorCode()
|
||||
dev.Error.Println(err)
|
||||
if ipcErr, ok := err.(*device.IPCError); ok {
|
||||
return ipcErr.ErrorCode()
|
||||
}
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -187,6 +184,15 @@ func wgBumpSockets(tunnelHandle int32) {
|
||||
device.SendKeepalivesToPeersWithCurrentKeypair()
|
||||
}
|
||||
|
||||
//export wgDisableSomeRoamingForBrokenMobileSemantics
|
||||
func wgDisableSomeRoamingForBrokenMobileSemantics(tunnelHandle int32) {
|
||||
device, ok := tunnelHandles[tunnelHandle]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
device.DisableSomeRoamingForBrokenMobileSemantics()
|
||||
}
|
||||
|
||||
//export wgVersion
|
||||
func wgVersion() *C.char {
|
||||
return versionString
|
||||
|
||||
Reference in New Issue
Block a user