summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Anderson <danderson@tailscale.com>2021-11-16 11:27:44 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2021-11-16 20:43:26 +0100
commit3cae233d69f79eddaa99c38305fe33977e3a706b (patch)
tree173095c58e77935c5d519bc0c2a1435c8cdabf8c
parent111e0566dce3fc3489cb75ee40b752b1b738e9c6 (diff)
device: fix nil pointer dereference in uapi read
Signed-off-by: David Anderson <danderson@tailscale.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--device/uapi.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/device/uapi.go b/device/uapi.go
index e33355d..87c5dd9 100644
--- a/device/uapi.go
+++ b/device/uapi.go
@@ -258,11 +258,11 @@ type ipcSetPeer struct {
}
func (peer *ipcSetPeer) handlePostConfig() {
- if peer.Peer == nil {
+ if peer.Peer == nil || peer.dummy {
return
}
peer.disableRoaming = peer.device.net.brokenRoaming && peer.endpoint != nil
- if !peer.dummy && peer.device.isUp() {
+ if peer.device.isUp() {
peer.Start()
if peer.pkaOn {
peer.SendKeepalive()