Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: netdev <netdev@vger.kernel.org>
Cc: Andy Green <andy@warmcat.com>, David Miller <davem@davemloft.net>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [RFC] allow device to stop packet mirror behaviour
Date: Tue, 07 Aug 2007 10:27:07 +0200	[thread overview]
Message-ID: <1186475227.4067.19.camel@johannes.berg> (raw)
In-Reply-To: <1186475155.4067.17.camel@johannes.berg>

This is the corresponding patch to mac80211.

It marks all monitor type interfaces with IFF_NO_MIRROR the reasons for
which I explained in the previous mail; it also marks the master device
with IFF_NO_MIRROR so you don't see *any* packets on the master device
(right now you see outgoing frames with 802.11 header.) We want to get
rid of it anyway so making it a bit more useless yet seems like a good
idea.

johannes

---
 net/mac80211/ieee80211.c       |    1 +
 net/mac80211/ieee80211_iface.c |    2 ++
 2 files changed, 3 insertions(+)

--- wireless-dev.orig/net/mac80211/ieee80211_iface.c	2007-08-06 21:14:37.398164177 +0200
+++ wireless-dev/net/mac80211/ieee80211_iface.c	2007-08-06 21:15:02.078164177 +0200
@@ -158,6 +158,7 @@ void ieee80211_if_set_type(struct net_de
 	int oldtype = sdata->type;
 
 	dev->hard_start_xmit = ieee80211_subif_start_xmit;
+	dev->flags &= ~IFF_NO_MIRROR;
 
 	sdata->type = type;
 	switch (type) {
@@ -216,6 +217,7 @@ void ieee80211_if_set_type(struct net_de
 	case IEEE80211_IF_TYPE_MNTR:
 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
 		dev->hard_start_xmit = ieee80211_monitor_start_xmit;
+		dev->flags |= IFF_NO_MIRROR;
 		break;
 	default:
 		printk(KERN_WARNING "%s: %s: Unknown interface type 0x%x",
--- wireless-dev.orig/net/mac80211/ieee80211.c	2007-08-06 21:15:01.898164177 +0200
+++ wireless-dev/net/mac80211/ieee80211.c	2007-08-06 21:15:02.088164177 +0200
@@ -5138,6 +5138,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(
 	mdev->stop = ieee80211_master_stop;
 	mdev->type = ARPHRD_IEEE80211;
 	mdev->hard_header_parse = header_parse_80211;
+	mdev->flags |= IFF_NO_MIRROR;
 
 	sdata->type = IEEE80211_IF_TYPE_AP;
 	sdata->dev = mdev;



  reply	other threads:[~2007-08-07  9:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-07  8:25 [RFC] allow device to stop packet mirror behaviour Johannes Berg
2007-08-07  8:27 ` Johannes Berg [this message]
2007-08-08  1:06 ` David Miller
2007-08-08  9:14   ` Johannes Berg
2007-08-08 10:17     ` David Miller
2007-08-08 10:32       ` Johannes Berg

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=1186475227.4067.19.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=andy@warmcat.com \
    --cc=davem@davemloft.net \
    --cc=linux-wireless@vger.kernel.org \
    --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