diff options
Diffstat (limited to '')
-rw-r--r-- | tunnel/winipcfg/interface_change_handler.go | 3 | ||||
-rw-r--r-- | tunnel/winipcfg/route_change_handler.go | 3 | ||||
-rw-r--r-- | tunnel/winipcfg/unicast_address_change_handler.go | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/tunnel/winipcfg/interface_change_handler.go b/tunnel/winipcfg/interface_change_handler.go index 50ea6448..57041719 100644 --- a/tunnel/winipcfg/interface_change_handler.go +++ b/tunnel/winipcfg/interface_change_handler.go @@ -64,9 +64,10 @@ func (callback *InterfaceChangeCallback) Unregister() error { } func interfaceChanged(callerContext uintptr, row *MibIPInterfaceRow, notificationType MibNotificationType) uintptr { + rowCopy := *row interfaceChangeMutex.Lock() for cb := range interfaceChangeCallbacks { - go cb.cb(notificationType, row) + go cb.cb(notificationType, &rowCopy) } interfaceChangeMutex.Unlock() return 0 diff --git a/tunnel/winipcfg/route_change_handler.go b/tunnel/winipcfg/route_change_handler.go index 4bdea672..cafa0e97 100644 --- a/tunnel/winipcfg/route_change_handler.go +++ b/tunnel/winipcfg/route_change_handler.go @@ -71,9 +71,10 @@ func (callback *RouteChangeCallback) Unregister() error { } func routeChanged(callerContext uintptr, row *MibIPforwardRow2, notificationType MibNotificationType) uintptr { + rowCopy := *row routeChangeMutex.Lock() for cb := range routeChangeCallbacks { - go cb.cb(notificationType, row) + go cb.cb(notificationType, &rowCopy) } routeChangeMutex.Unlock() return 0 diff --git a/tunnel/winipcfg/unicast_address_change_handler.go b/tunnel/winipcfg/unicast_address_change_handler.go index b126e2ed..fdd2e058 100644 --- a/tunnel/winipcfg/unicast_address_change_handler.go +++ b/tunnel/winipcfg/unicast_address_change_handler.go @@ -64,9 +64,10 @@ func (callback *UnicastAddressChangeCallback) Unregister() error { } func unicastAddressChanged(callerContext uintptr, row *MibUnicastIPAddressRow, notificationType MibNotificationType) uintptr { + rowCopy := *row unicastAddressChangeMutex.Lock() for cb := range unicastAddressChangeCallbacks { - go cb.cb(notificationType, row) + go cb.cb(notificationType, &rowCopy) } unicastAddressChangeMutex.Unlock() return 0 |