Re: Proposed ad-hoc channel bug patch
- From: Dan Williams <dcbw redhat com>
- To: Ohad Lutzky <ohad lutzky net>
- Cc: gabik <gabik cs technion ac il>, networkmanager-list gnome org
- Subject: Re: Proposed ad-hoc channel bug patch
- Date: Tue, 25 Dec 2007 18:32:17 -0500
On Tue, 2007-12-25 at 18:22 +0200, Ohad Lutzky wrote:
> On Dec 25, 2007 4:03 PM, Dan Williams <dcbw redhat com> wrote:
> > On Tue, 2007-12-25 at 10:29 +0200, Ohad Lutzky wrote:
> > > Hi Dan,
> > >
> > > Thanks for the info. A few questions -
> > >
> > > * Is there any chance indeed that the feature will be backported into
> > > wpa_supplicant 0.5.x? Or is it a big restructuring of wpa_sup which
> > > will make this very difficult?
> >
> > No, it's pretty easy and fairly contained. It's just the config option
> > and the driver hooks for setting the frequency.
> >
> > > * Which version of NM uses wpa_supplicant 0.6.x, with the new feature?
> > > Is a GUI for setting the channel present? Is any sort of channel set
> > > for ad-hoc mode?
> >
> > No version of NM requires 0.6.x. All the D-Bus interface work has been
> > done on wpa_supplicant 0.5.7 and later but the changes also get applied
> > to the 0.6.x branch.
> >
> > NM does not yet honor the channel setting for either adhoc or
> > infrastructure mode because the backend wpa_supplicant support is not
> > yet there.
>
> I'm not sure I understand... is the wpa_supplicant support for channel
> setting there in 0.6.x or not? When can we expect NM to use this
> support?
Attached is a compile-tested backport of the patch for adhoc frequency
for wpa_supplicant 0.5.x branch git head. Can you test whether this
works with plain wpa_supplicant with your card/driver and let me know?
Dan
> I'm trying to use NM from my application which uses ad-hoc networking
> heavily (a port of a Windows application, specifically), and current
> behavior is completely broken for all of the cards I have. Would it be
> acceptable to use this patch downstream (Debian, Ubuntu) for the time
> being?
>
> >
> > Dan
> >
> >
> > > Much thanks,
> > > Ohad.
> > >
> > > On Dec 25, 2007 12:57 AM, Dan Williams <dcbw redhat com> wrote:
> > > > On Thu, 2007-12-20 at 10:55 +0200, Ohad Lutzky wrote:
> > > > > Hi all,
> > > > >
> > > > > Apparently it's not a WPA issue after all. Please check patch attached here:
> > > > >
> > > > > https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/112009/comments/12
> > > >
> > > > Contrary to the bug report, it's _totally_ a wpa_supplicant issue.
> > > > wpa_supplicant 0.6.x has the required config option, it needs to be
> > > > backported to wpa_supplicant 0.5.x. NM should _not_ be setting any
> > > > wireless attributes like channel, BSSID, or SSID itself.
> > > >
> > > > So the patch is wrong.
> > > >
> > > > Dan
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>
>
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 6a21bbc..10c454f 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1158,7 +1158,8 @@ static const struct parse_data ssid_fields[] = {
{ INT_RANGE(ieee80211w, 0, 2) },
#endif /* CONFIG_IEEE80211W */
{ INT_RANGE(peerkey, 0, 1) },
- { INT_RANGE(mixed_cell, 0, 1) }
+ { INT_RANGE(mixed_cell, 0, 1) },
+ { INT_RANGE(frequency, 0, 10000) }
};
#undef OFFSET
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index d4c3654..393f750 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -851,6 +851,18 @@ struct wpa_ssid {
IEEE80211W_REQUIRED = 2
} ieee80211w;
#endif /* CONFIG_IEEE80211W */
+
+ /**
+ * frequency - Channel frequency in megahertz (MHz) for IBSS
+ *
+ * This value is used to configure the initial channel for IBSS (adhoc)
+ * networks, e.g., 2412 = IEEE 802.11b/g channel 1. It is ignored in
+ * the infrastructure mode. In addition, this value is only used by the
+ * station that creates the IBSS. If an IBSS network with the
+ * configured SSID is already present, the frequency of the network
+ * will be used instead of this configured value.
+ */
+ int frequency;
};
int wpa_config_allowed_eap_method(struct wpa_ssid *ssid, int vendor,
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index d5342fe..35ddbcd 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1468,6 +1468,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
params.ssid = ssid->ssid;
params.ssid_len = ssid->ssid_len;
}
+ if (ssid->mode == 1 && ssid->frequency > 0 && params.freq == 0)
+ params.freq = ssid->frequency; /* Initial channel for IBSS */
params.wpa_ie = wpa_ie;
params.wpa_ie_len = wpa_ie_len;
params.pairwise_suite = cipher_pairwise;
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index dce9d87..ec8b0ee 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -192,6 +192,13 @@ fast_reauth=1
# proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not
# both), and psk must also be set.
#
+# frequency: Channel frequency in megahertz (MHz) for IBSS, e.g.,
+# 2412 = IEEE 802.11b/g channel 1. This value is used to configure the initial
+# channel for IBSS (adhoc) networks. It is ignored in the infrastructure mode.
+# In addition, this value is only used by the station that creates the IBSS. If
+# an IBSS network with the configured SSID is already present, the frequency of
+# the network will be used instead of this configured value.
+#
# proto: list of accepted protocols
# WPA = WPA/IEEE 802.11i/D3.0
# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN)
@@ -657,6 +664,7 @@ network={
network={
ssid="test adhoc"
mode=1
+ frequency=2412
proto=WPA
key_mgmt=WPA-NONE
pairwise=NONE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]