From 3cae233d69f79eddaa99c38305fe33977e3a706b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 16 Nov 2021 11:27:44 -0800 Subject: [PATCH] device: fix nil pointer dereference in uapi read Signed-off-by: David Anderson Signed-off-by: Jason A. Donenfeld --- device/uapi.go | 4 ++-- 1 file 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()