Skip to content

Commit 731200d

Browse files
milan-zededaeriknordmark
authored andcommitted
Fix hasWifiPortConfig to handle in-progress DPC testing
The original implementation of `hasWifiPortConfig()` function would not work properly if testing was in progress. It could lead to an unintended RF-kill of all wlan devices during testing of a new DPC (typically after EVE image upgrade). Signed-off-by: Milan Lenco <[email protected]>
1 parent 6a66b2d commit 731200d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/pillar/devicenetwork/wlan.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ func updateWlanConfig(ctx *DeviceNetworkContext, oldCfg *types.DevicePortConfig,
5858
}
5959

6060
func hasWifiPortConfig(ctx *DeviceNetworkContext) bool {
61-
for _, portCfg := range ctx.DevicePortConfig.Ports {
61+
dpc := ctx.DevicePortConfig
62+
if ctx.Pending.Inprogress {
63+
dpc = &ctx.Pending.PendDPC
64+
}
65+
for _, portCfg := range dpc.Ports {
6266
if portCfg.WirelessCfg.WType == types.WirelessTypeWifi {
6367
return true
6468
}

0 commit comments

Comments
 (0)