From owner-svn-src-head@freebsd.org Thu Jun 23 00:56:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FC41B72AB4; Thu, 23 Jun 2016 00:56:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C72541F5A; Thu, 23 Jun 2016 00:56:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N0usQs076790; Thu, 23 Jun 2016 00:56:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N0usOG076788; Thu, 23 Jun 2016 00:56:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606230056.u5N0usOG076788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 23 Jun 2016 00:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302101 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:56:56 -0000 Author: adrian Date: Thu Jun 23 00:56:54 2016 New Revision: 302101 URL: https://svnweb.freebsd.org/changeset/base/302101 Log: [iwm] Use vap->iv_myaddr instead of ic->ic_macaddr when vap != NULL. ic_macaddr is only used for the initial mac address provided by NVM. We should rather use vap->iv_myaddr when vap != NULL, to allow the MAC address to be changed later with ifconfig(8). Submitted by: Imre Vadasz Reviewed by: avos Approved by: re (gjb) Obtained from: DragonflyBSD git 4aee7a78275676d22d14c04177bd0c9377d91478 Differential Revision: https://reviews.freebsd.org/D6743 Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwm_scan.c Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Jun 23 00:54:14 2016 (r302100) +++ head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Jun 23 00:56:54 2016 (r302101) @@ -275,7 +275,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_s */ cmd->tsf_id = htole32(IWM_DEFAULT_TSFID); - IEEE80211_ADDR_COPY(cmd->node_addr, ic->ic_macaddr); + IEEE80211_ADDR_COPY(cmd->node_addr, vap->iv_myaddr); /* * XXX should we error out if in_assoc is 1 and ni == NULL? Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Thu Jun 23 00:54:14 2016 (r302100) +++ head/sys/dev/iwm/if_iwm_scan.c Thu Jun 23 00:56:54 2016 (r302101) @@ -371,6 +371,8 @@ iwm_mvm_scan_request(struct iwm_softc *s .dataflags = { IWM_HCMD_DFL_NOCOPY, }, }; struct iwm_scan_cmd *cmd = sc->sc_scan_cmd; + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); int is_assoc = 0; int ret; uint32_t status; @@ -421,8 +423,9 @@ iwm_mvm_scan_request(struct iwm_softc *s cmd->tx_cmd.len = htole16(iwm_mvm_fill_probe_req(sc, (struct ieee80211_frame *)cmd->data, - sc->sc_ic.ic_macaddr, n_ssids, ssid, ssid_len, - NULL, 0, sc->sc_capa_max_probe_len)); + vap ? vap->iv_myaddr : ic->ic_macaddr, n_ssids, + ssid, ssid_len, NULL, 0, + sc->sc_capa_max_probe_len)); cmd->channel_count = iwm_mvm_scan_fill_channels(sc, cmd, flags, n_ssids, basic_ssid);