netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
To: Michael Wu <flamingice-R9e9/4HEdknk1uMJSBkQmQ@public.gmane.org>
Cc: Daniel Drake <dsd-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>,
	johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] ieee80211_if_set_type: make check for master dev more explicit
Date: Thu, 4 Oct 2007 19:02:48 -0400	[thread overview]
Message-ID: <20071004230248.GN6037@tuxdriver.com> (raw)
In-Reply-To: <200710041726.11744.flamingice-R9e9/4HEdknk1uMJSBkQmQ@public.gmane.org>

On Thu, Oct 04, 2007 at 05:26:11PM -0400, Michael Wu wrote:
> On Thursday 04 October 2007 14:09, John W. Linville wrote:
> > diff --git a/net/mac80211/ieee80211_iface.c
> > b/net/mac80211/ieee80211_iface.c index be7e77f..6607b80 100644
> > --- a/net/mac80211/ieee80211_iface.c
> > +++ b/net/mac80211/ieee80211_iface.c
> > @@ -106,7 +106,7 @@ void ieee80211_if_set_type(struct net_device *dev, int
> > type) * which already has a hard_start_xmit routine assigned
> >  	 * which must not be changed.
> >  	 */
> > -	if (!dev->hard_start_xmit)
> > +	if (dev->type != ARPHRD_IEEE80211)
> The standard way of checking for the master device is
> dev == sdata->local->mdev
> 
> wme.c doesn't quite follow this but that code needs to die anyway.
> 
> This does look nicer than the other patch.

Alright...better?

---

From: John W. Linville <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Subject: [PATCH] ieee80211_if_set_type: make check for master dev more explicit

Problem description by Daniel Drake <dsd-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>:

"This sequence of events causes loss of connectivity:

<plug in>
<associate as normal in managed mode>
ifconfig eth7 down
iwconfig eth7 mode monitor
ifconfig eth7 up
ifconfig eth7 down
iwconfig eth7 mode managed
<associate as normal>

At this point you are associated but TX does not work. This is because
the eth7 hard_start_xmit is still ieee80211_monitor_start_xmit."

The problem is caused by ieee80211_if_set_type checking for a non-zero
hard_start_xmit pointer value in order to avoid changing that value for
master devices.  The fix is to make that check more explicitly linked to
master devices rather than simply checking if the value has been
previously set.

CC: Daniel Drake <dsd-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
Signed-off-by: John W. Linville <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
---
 net/mac80211/ieee80211_iface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/ieee80211_iface.c b/net/mac80211/ieee80211_iface.c
index be7e77f..43e505d 100644
--- a/net/mac80211/ieee80211_iface.c
+++ b/net/mac80211/ieee80211_iface.c
@@ -106,7 +106,7 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
 	 * which already has a hard_start_xmit routine assigned
 	 * which must not be changed.
 	 */
-	if (!dev->hard_start_xmit)
+	if (dev != sdata->local->mdev)
 		dev->hard_start_xmit = ieee80211_subif_start_xmit;
 
 	/*
-- 
1.5.2.4


-- 
John W. Linville
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org

  parent reply	other threads:[~2007-10-04 23:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-04 11:33 [PATCH] mac80211: Fix TX after monitor interface is converted to managed Daniel Drake
2007-10-04 14:34 ` Michael Wu
2007-10-04 15:06   ` Michael Buesch
     [not found]     ` <200710041706.06182.mb-fseUSCV1ubazQB+pC5nmwQ@public.gmane.org>
2007-10-04 15:14       ` Michael Wu
2007-10-04 15:19     ` John W. Linville
2007-10-04 17:11       ` Michael Wu
2007-10-04 18:15         ` John W. Linville
2007-10-04 21:16           ` Michael Wu
2007-10-04 21:31           ` Roland Dreier
2007-10-04 22:13             ` John W. Linville
2007-10-04 18:12   ` Johannes Berg
2007-10-04 15:54 ` Stephen Hemminger
     [not found]   ` <20071004085440.008216c6-s08KbqtN0aBORcJjwVk881hTQxXnIo14@public.gmane.org>
2007-10-04 16:56     ` Michael Wu
2007-10-04 18:07 ` John W. Linville
2007-10-04 18:09 ` [PATCH] ieee80211_if_set_type: make check for master dev more explicit John W. Linville
2007-10-04 18:44   ` Johannes Berg
     [not found]     ` <1191523488.7367.16.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2007-10-04 19:13       ` John W. Linville
     [not found]         ` <20071004191301.GJ6037-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2007-10-05 12:01           ` Johannes Berg
     [not found]   ` <20071004180900.GG6037-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2007-10-04 21:26     ` Michael Wu
     [not found]       ` <200710041726.11744.flamingice-R9e9/4HEdknk1uMJSBkQmQ@public.gmane.org>
2007-10-04 23:02         ` John W. Linville [this message]
     [not found]           ` <20071004230248.GN6037-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2007-10-06  2:23             ` Michael Wu

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=20071004230248.GN6037@tuxdriver.com \
    --to=linville-2xusbdqka4r54taoqtywwq@public.gmane.org \
    --cc=dsd-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org \
    --cc=flamingice-R9e9/4HEdknk1uMJSBkQmQ@public.gmane.org \
    --cc=johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).