From: David Kimdon <david.kimdon@devicescape.com>
To: netdev@vger.kernel.org
Cc: "John W. Linville" <linville@tuxdriver.com>,
Jiri Benc <jbenc@suse.cz>,
David Kimdon <david.kimdon@devicescape.com>
Subject: [patch] d80211: remove sub-interface mac address policy
Date: Thu, 14 Sep 2006 07:33:21 -0700 [thread overview]
Message-ID: <20060914143321.GA1962@devicescape.com> (raw)
[-- Attachment #1: remove_mac_addr_policy.patch --]
[-- Type: text/plain, Size: 2102 bytes --]
Wireless vlan interfaces need to have the same mac address as
other sub interfaces. Rather than complicate the kernel here by
adding yet another case where uniqueness is not required, remove
the check on mac address uniqueness altogether.
We should not implement a mac address allocation policy here. It
is difficult to get it right in all cases and does not belong in
the kernel. It is better to leave this to be implemented as a
userspace policy.
Signed-off-by: David Kimdon <david.kimdon@devicescape.com>
Index: linux-2.6.16/net/d80211/ieee80211.c
===================================================================
--- linux-2.6.16.orig/net/d80211/ieee80211.c
+++ linux-2.6.16/net/d80211/ieee80211.c
@@ -2116,17 +2116,6 @@ static struct net_device_stats *ieee8021
return &(sdata->stats);
}
-static inline int identical_mac_addr_allowed(int type1, int type2)
-{
- return (type1 == IEEE80211_IF_TYPE_MNTR ||
- type2 == IEEE80211_IF_TYPE_MNTR ||
- (type1 == IEEE80211_IF_TYPE_AP &&
- type2 == IEEE80211_IF_TYPE_WDS) ||
- (type1 == IEEE80211_IF_TYPE_WDS &&
- (type2 == IEEE80211_IF_TYPE_WDS ||
- type2 == IEEE80211_IF_TYPE_AP)));
-}
-
static int ieee80211_master_open(struct net_device *dev)
{
struct ieee80211_local *local = dev->ieee80211_ptr;
@@ -2202,22 +2191,12 @@ static void ieee80211_start_hard_monitor
static int ieee80211_open(struct net_device *dev)
{
- struct ieee80211_sub_if_data *sdata, *nsdata;
+ struct ieee80211_sub_if_data *sdata;
struct ieee80211_local *local = dev->ieee80211_ptr;
struct ieee80211_if_init_conf conf;
int res;
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- list_for_each_entry(nsdata, &local->sub_if_list, list) {
- struct net_device *ndev = nsdata->dev;
-
- if (ndev != dev && ndev != local->mdev &&
- netif_running(ndev) &&
- memcmp(dev->dev_addr, ndev->dev_addr, ETH_ALEN) == 0 &&
- !identical_mac_addr_allowed(sdata->type, nsdata->type)) {
- return -ENOTUNIQ;
- }
- }
if (sdata->type == IEEE80211_IF_TYPE_WDS &&
memcmp(sdata->u.wds.remote_addr, "\0\0\0\0\0\0", ETH_ALEN) == 0)
return -ENOLINK;
--
next reply other threads:[~2006-09-14 14:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-14 14:33 David Kimdon [this message]
2006-09-21 18:09 ` [patch] d80211: remove sub-interface mac address policy Jiri Benc
2006-09-21 21:10 ` David Kimdon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060914143321.GA1962@devicescape.com \
--to=david.kimdon@devicescape.com \
--cc=jbenc@suse.cz \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).