From 68edea432c9f4eb369a646374c7b6a31106daa21 Mon Sep 17 00:00:00 2001 From: stsp Date: Mon, 19 Feb 2024 21:23:02 +0000 Subject: [PATCH] Make bwfm(4) work with MAC addresses set via ifconfig lladdr. Patch by Todd Carson Tests by Todd Carson and naddy@ ok tobhe@ --- sys/dev/ic/bwfm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index dfa7a1973d2..5f380f72456 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfm.c,v 1.110 2023/10/09 21:49:34 kettenis Exp $ */ +/* $OpenBSD: bwfm.c,v 1.111 2024/02/19 21:23:02 stsp Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -451,6 +451,16 @@ bwfm_init(struct ifnet *ifp) return; } sc->sc_initialized = 1; + } else { + /* Update MAC in case the upper layers changed it. */ + IEEE80211_ADDR_COPY(ic->ic_myaddr, + ((struct arpcom *)ifp)->ac_enaddr); + if (bwfm_fwvar_var_set_data(sc, "cur_etheraddr", + ic->ic_myaddr, sizeof(ic->ic_myaddr))) { + printf("%s: could not write MAC address\n", + DEVNAME(sc)); + return; + } } /* Select default channel */ -- 2.20.1