linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: Michael Wu <flamingice@sourmilk.net>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Jouni Malinen <j@w1.fi>,
	Stephen Hemminger <shemminger@linux-foundation.org>
Subject: [PATCH] mac80211: fix header ops
Date: Wed, 12 Dec 2007 16:31:52 +0100	[thread overview]
Message-ID: <1197473512.6558.96.camel@johannes.berg> (raw)

When using recvfrom() on a SOCK_DGRAM packet socket, I noticed that the MAC
address passed back for wireless frames was always completely wrong. The
reason for this is that the header parse function assigned to our virtual
interfaces is a function parsing an 802.11 rather than 802.3 header. This
patch fixes it by keeping the default ethernet header operations assigned.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
I think this should go into 2.6.24. I have no idea what broke this or if
it has been wrong forever... However, my eapol stuff relies on this fix.

There is one small problem with this: monitor interfaces are also set up
with this function but have 802.11 frame type. I have found that to not
matter but I'm not entirely sure. Does anybody think it does? In that
case I'll have to (re-)assign this conditionally when changing the
interface type.

 net/mac80211/ieee80211.c |    1 -
 1 file changed, 1 deletion(-)

--- everything.orig/net/mac80211/ieee80211.c	2007-12-12 16:24:31.929129394 +0100
+++ everything/net/mac80211/ieee80211.c	2007-12-12 16:25:23.609131835 +0100
@@ -449,7 +449,6 @@ static const struct header_ops ieee80211
 void ieee80211_if_setup(struct net_device *dev)
 {
 	ether_setup(dev);
-	dev->header_ops = &ieee80211_header_ops;
 	dev->hard_start_xmit = ieee80211_subif_start_xmit;
 	dev->wireless_handlers = &ieee80211_iw_handler_def;
 	dev->set_multicast_list = ieee80211_set_multicast_list;



                 reply	other threads:[~2007-12-12 17:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1197473512.6558.96.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=flamingice@sourmilk.net \
    --cc=j@w1.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=shemminger@linux-foundation.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).