From owner-freebsd-wireless@FreeBSD.ORG Sun May 6 01:20:12 2012 Return-Path: Delivered-To: freebsd-wireless@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 192E11065670 for ; Sun, 6 May 2012 01:20:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id ED8058FC15 for ; Sun, 6 May 2012 01:20:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q461KB1M050435 for ; Sun, 6 May 2012 01:20:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q461KB7B050434; Sun, 6 May 2012 01:20:11 GMT (envelope-from gnats) Date: Sun, 6 May 2012 01:20:11 GMT Message-Id: <201205060120.q461KB7B050434@freefall.freebsd.org> To: freebsd-wireless@FreeBSD.org From: Erik Fonnesbeck Cc: Subject: Re: bin/144109: hostapd(8) uses the MAC of the wireless interface, but should use the BSSID. X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Erik Fonnesbeck List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2012 01:20:12 -0000 The following reply was made to PR bin/144109; it has been noted by GNATS. From: Erik Fonnesbeck To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/144109: hostapd(8) uses the MAC of the wireless interface, but should use the BSSID. Date: Sat, 5 May 2012 19:14:44 -0600 --00248c6a66a6fc9c5f04bf53e0fd Content-Type: text/plain; charset=ISO-8859-1 This patch I made a while ago gets the BSSID instead of the interface's ethernet MAC so that hostapd works even if the two do not match. It is incomplete, however; because with this patch hostapd does not work if the interface was not up already when hostapd was started (it fails to acquire the BSSID). If there is some way to get it without the interface being up, that would probably be better. It must exist somewhere, because it is obviously already stored somewhere, but I just do not know how to get it. If it is not possible, it could be necessary to bring up the interface a bit sooner in hostapd. --00248c6a66a6fc9c5f04bf53e0fd Content-Type: application/octet-stream; name="hostapd-eth_get-bssid-incomplete.patch" Content-Disposition: attachment; filename="hostapd-eth_get-bssid-incomplete.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h1ve8srd0 LS0tIHVzci5zYmluL3dwYS9sMl9wYWNrZXQuYy5vbGQJMjAxMC0xMi0wMSAxOToxNTo0Ni4wMDAw MDAwMDAgLTA3MDAKKysrIHVzci5zYmluL3dwYS9sMl9wYWNrZXQuYwkyMDEwLTEyLTAxIDE5OjIx OjI2LjAwMDAwMDAwMCAtMDcwMApAQCAtMjksNiArMjksNyBAQAogI2luY2x1ZGUgPG5ldC9yb3V0 ZS5oPgogI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4KICNpbmNsdWRlIDxhcnBhL2luZXQuaD4KKyNp bmNsdWRlICJuZXQ4MDIxMS9pZWVlODAyMTFfaW9jdGwuaCIKIAogI2luY2x1ZGUgPHN0ZGxpYi5o PgogI2luY2x1ZGUgPHN0ZGlvLmg+CkBAIC0yMjEsMzggKzIyMiwyNSBAQAogc3RhdGljIGludAog ZXRoX2dldChjb25zdCBjaGFyICpkZXZpY2UsIHU4IGVhW0VUSF9BTEVOXSkKIHsKLQlzdHJ1Y3Qg aWZfbXNnaGRyICppZm07Ci0Jc3RydWN0IHNvY2thZGRyX2RsICpzZGw7Ci0JdV9jaGFyICpwLCAq YnVmOwotCXNpemVfdCBsZW47Ci0JaW50IG1pYltdID0geyBDVExfTkVULCBBRl9ST1VURSwgMCwg QUZfTElOSywgTkVUX1JUX0lGTElTVCwgMCB9OworCXN0cnVjdCBpZWVlODAyMTFyZXEgaXJlcTsK KwlpbnQgczsKIAotCWlmIChzeXNjdGwobWliLCA2LCBOVUxMLCAm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