From patchwork Sat Dec 19 14:59:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 7890351 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CDC259F1C2 for ; Sat, 19 Dec 2015 15:01:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D679D204D5 for ; Sat, 19 Dec 2015 15:01:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9806B2047D for ; Sat, 19 Dec 2015 15:01:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964788AbbLSPBM (ORCPT ); Sat, 19 Dec 2015 10:01:12 -0500 Received: from mail-qg0-f50.google.com ([209.85.192.50]:34276 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753880AbbLSPBK (ORCPT ); Sat, 19 Dec 2015 10:01:10 -0500 Received: by mail-qg0-f50.google.com with SMTP id 74so7669007qgh.1 for ; Sat, 19 Dec 2015 07:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobcopeland-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=y5caDn+2Uf7QFxhj1IOqbXJKJELQthhPiorAkRGKjLw=; b=Y1RC2tO8bq5FigPE384gk4AT4uFLC5Ar9zi+tdKwGBiQ4qfyfWqBlxwFa7OHA2Pvvc XpMKnxZ/BNl0dpX0kjO6gBNRZk/voL0fth/SLYPcV5pDgAcnaaanfiucB/jAXsu8RCeV llu72KST9BukyO7r4tboep9kMcsiKKe+KdzEH/PrfNNklRjNBqvDzrb1toFoqZhCnSO/ +fuwe/p9+afpIqbpj2+gvdpoMQRDQfw4o1vyghU7r+Q8pUvzNlXACGrcwbhS1ybxjLdT lRaGyCxda1EANpyRF563dQaTWx6n1BPqm45rn22kJHFbiwf/+nQCle84O/mJSDx0ALjt RWlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=y5caDn+2Uf7QFxhj1IOqbXJKJELQthhPiorAkRGKjLw=; b=RfdfcQMREHaMyCePMr+pcv6HMyXDX4d523a7xrq8gukUILEo/ItImL2PWOIU35M+Xb TdZF4jl4cgFDZ+t4tWN4ZUFeGHaVYtiqiAX1Hxem6bPKGZ1LXUCuiNbfSdkKgTc/7jpd v2VIbCZ6frFUxeBf/yRfJAaAJ2wpkwq/KesV+4fpSfp39G268XkNrkl879ZHf4cPjdsl Lxk4BPMlpg+t0PPgfdFsm7VUdn/dAEkJk5zznk3lqQxlNGuJIwCJyJhB5m0wjKz6sE1s DhHBLsrmm8ucH+/1Px91O60Z3Dnxg3TtNwaiRPq8wJBAhCeZGFk+a138wYwU6rz/LNDg 0EGg== X-Gm-Message-State: ALoCoQnhpCoA/jRIpJXOkV/rvxInobzmJtl5VkUzVBNgYq/kXkTmb3IESCNBP1ZGplD/xWiZD7iJVcLMl6LzTw16F4a7YXdbFQ== X-Received: by 10.140.101.130 with SMTP id u2mr13191454qge.71.1450537269829; Sat, 19 Dec 2015 07:01:09 -0800 (PST) Received: from hash ([2001:470:1d:6db:230:48ff:fe9d:9c89]) by smtp.gmail.com with ESMTPSA id w14sm8991771qge.24.2015.12.19.07.01.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Dec 2015 07:01:09 -0800 (PST) Received: from bob by hash with local (Exim 4.84) (envelope-from ) id 1aAJ0J-0007ED-Ey; Sat, 19 Dec 2015 10:01:03 -0500 From: Bob Copeland To: linux-wireless@vger.kernel.org Cc: Johannes Berg , arwelle@cert.org, greearb@candelatech.com, Bob Copeland Subject: [PATCH] Revert "mac80211_hwsim: support any address in userspace" Date: Sat, 19 Dec 2015 09:59:37 -0500 Message-Id: <1450537177-27440-1-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 2.1.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit cd37a90b2a417e5882414e19954eeed174aa4d29. Different userspace programs interpreted HWSIM_ATTR_ADDR_TRANSMITTER and HWSIM_ATTR_ADDR_RECEIVER differently: some expected it to be an unchanging hardware address that is tied to the radio despite which address is configured on the interface, while others expected to be a copy of the address in the frame (the configured address). The intent of the original authors is unclear. The latter interpretation doesn't really work properly with multiple vifs and broadcast frames. Also, as the TA is already in the frame, userspace programs can actually support configured addresses in the former interpretation by mapping between them and the supplied HWSIM_ATTR_ADDR_TRANSMITTER. So, in the interest of API stability, revert to the previous mode of operation and going forward use the former interpretation. Signed-off-by: Bob Copeland --- I made minimal changes to wmediumd and it works fine so far with the revert. I've a little more to do there, but it is good enough that hostapd test case passes with the new wmediumd binary, with or without this patch. drivers/net/wireless/mac80211_hwsim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index c32889a1e39c..a28414c50edf 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -991,7 +991,8 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw, goto nla_put_failure; } - if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER, ETH_ALEN, hdr->addr2)) + if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER, + ETH_ALEN, data->addresses[1].addr)) goto nla_put_failure; /* We get the skb->data */ @@ -2736,7 +2737,7 @@ static struct mac80211_hwsim_data *get_hwsim_data_ref_from_addr(const u8 *addr) spin_lock_bh(&hwsim_radio_lock); list_for_each_entry(data, &hwsim_radios, list) { - if (mac80211_hwsim_addr_match(data, addr)) { + if (memcmp(data->addresses[1].addr, addr, ETH_ALEN) == 0) { _found = true; break; }