linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bas Hulsken <bhulsken@hotmail.com>
To: linux-wireless@vger.kernel.org
Subject: Re: hostapd with mac80211 and rt2500pci: hostapd doesn't receive clients EAPOL keys unless mon.wlan1 is promiscuous
Date: Sun, 23 Mar 2008 14:00:37 +0100	[thread overview]
Message-ID: <1206277237.2902.37.camel@Bas> (raw)
In-Reply-To: <1206274341.16475.185.camel@johannes.berg>

Hi Johannes,

On Sun, 2008-03-23 at 13:12 +0100, Johannes Berg wrote:
> > Ok, to summarize: hostapd doesn't seem to work at the moment with
> > rt2500pci and lates git.wireless-testing. The cause seems to be that
> > EOPOL key send from the client does not arrive at hostapd. This can be
> > 'fixed' by running tethereal on the monitor interface. Any thoughts on
> > what might cause this?
> 
> Can you stick a printk into the driver to print out
>  * the configured MAC address
>  * the filter flags configuration?
> 
> Whenever either changes.
before I blow up the system, I guess this should do the trick?
(remember, I'm not a kernel hacker ;-):

--- compat-wireless-2.6/drivers/net/wireless/rt2x00/rt2500pci.c 2008-03-12 09:49:21.000000000 +0100
+++ ./rt2500pci.c       2008-03-23 13:52:55.000000000 +0100
@@ -300,10 +300,11 @@
                rt2x00pci_register_write(rt2x00dev, CSR14, reg);
        }

-       if (flags & CONFIG_UPDATE_MAC)
+       if (flags & CONFIG_UPDATE_MAC) {
                rt2x00pci_register_multiwrite(rt2x00dev, CSR3,
                                              conf->mac, sizeof(conf->mac));
-
+    printk(KERN_INFO "rt2500pci MAC changed: %s\n", mac2str(conf->mac));
+       }
        if (flags & CONFIG_UPDATE_BSSID)
                rt2x00pci_register_multiwrite(rt2x00dev, CSR5,
                                              conf->bssid, sizeof(conf->bssid));
@@ -1767,6 +1768,7 @@
                return;
        rt2x00dev->packet_filter = *total_flags;

+  printk(KERN_INFO "rt2500pci filter_flags: %d\n", rt2x00dev->packet_filter);
        /*
         * Start configuration steps.
         * Note that the version error will always be dropped


> johannes

oh.. btw, I also had to patch hostapd a bit.. it seemed trivial, but
perhaps I'm just stupid. It seems that the NL80211_STA_STAT_* stuff in
current wireless-testing has been renamed to NL80211_STA_INFO_*, so I
renamed all occurrences of that in driver_nl80211.c. Was that ok? This
is the patch I applied:
--- hostap/hostapd/driver_nl80211.c     2008-03-18 13:53:20.000000000 +0100
+++ ./driver_nl80211.c  2008-03-22 17:28:39.000000000 +0100
@@ -598,11 +598,11 @@
        struct nlattr *tb[NL80211_ATTR_MAX + 1];
        struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
        struct hostap_sta_driver_data *data = arg;
-       struct nlattr *stats[NL80211_STA_STAT_MAX + 1];
-       static struct nla_policy stats_policy[NL80211_STA_STAT_MAX + 1] = {
-               [NL80211_STA_STAT_INACTIVE_TIME] = { .type = NLA_U32 },
-               [NL80211_STA_STAT_RX_BYTES] = { .type = NLA_U32 },
-               [NL80211_STA_STAT_TX_BYTES] = { .type = NLA_U32 },
+       struct nlattr *stats[NL80211_STA_INFO_MAX + 1];
+       static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = {
+               [NL80211_STA_INFO_INACTIVE_TIME] = { .type = NLA_U32 },
+               [NL80211_STA_INFO_RX_BYTES] = { .type = NLA_U32 },
+               [NL80211_STA_INFO_TX_BYTES] = { .type = NLA_U32 },
        };

        nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
@@ -614,24 +614,24 @@
         * the kernel starts sending station notifications.
         */

-       if (!tb[NL80211_ATTR_STA_STATS]) {
+       if (!tb[NL80211_ATTR_STA_INFO]) {
                wpa_printf(MSG_DEBUG, "sta stats missing!");
                return NL_SKIP;
        }
-       if (nla_parse_nested(stats, NL80211_STA_STAT_MAX,
-                            tb[NL80211_ATTR_STA_STATS],
+       if (nla_parse_nested(stats, NL80211_STA_INFO_MAX,
+                            tb[NL80211_ATTR_STA_INFO],
                             stats_policy)) {
                wpa_printf(MSG_DEBUG, "failed to parse nested attributes!");
                return NL_SKIP;
        }

-       if (stats[NL80211_STA_STAT_INACTIVE_TIME])
+       if (stats[NL80211_STA_INFO_INACTIVE_TIME])
                data->inactive_msec =
-                       nla_get_u32(stats[NL80211_STA_STAT_INACTIVE_TIME]);
-       if (stats[NL80211_STA_STAT_RX_BYTES])
-               data->rx_bytes = nla_get_u32(stats[NL80211_STA_STAT_RX_BYTES]);
-       if (stats[NL80211_STA_STAT_TX_BYTES])
-               data->rx_bytes = nla_get_u32(stats[NL80211_STA_STAT_TX_BYTES]);
+                       nla_get_u32(stats[NL80211_STA_INFO_INACTIVE_TIME]);
+       if (stats[NL80211_STA_INFO_RX_BYTES])
+               data->rx_bytes = nla_get_u32(stats[NL80211_STA_INFO_RX_BYTES]);
+       if (stats[NL80211_STA_INFO_TX_BYTES])
+               data->rx_bytes = nla_get_u32(stats[NL80211_STA_INFO_TX_BYTES]);

        return NL_SKIP;
 }


cheers,
Bas



  reply	other threads:[~2008-03-23 13:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-23 11:24 hostapd with mac80211 and rt2500pci: hostapd doesn't receive clients EAPOL keys unless mon.wlan1 is promiscuous Bas Hulsken
2008-03-23 12:12 ` Johannes Berg
2008-03-23 13:00   ` Bas Hulsken [this message]
2008-03-23 14:14     ` Bas Hulsken
2008-03-26 18:51       ` Bas Hulsken
2008-03-27 12:59         ` 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=1206277237.2902.37.camel@Bas \
    --to=bhulsken@hotmail.com \
    --cc=linux-wireless@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).