mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 21:50:27 +01:00
2004-10-12 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerDevice.c - Force wireless cards into Infrastructure mode before we use them git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@213 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
b6df634a51
commit
8a87f57d79
2 changed files with 20 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2004-10-12 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/NetworkManagerDevice.c
|
||||
- Force wireless cards into Infrastructure mode before we use them
|
||||
|
||||
2004-10-12 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* TODO
|
||||
|
|
|
|||
|
|
@ -1203,8 +1203,23 @@ static gboolean nm_device_activate_wireless (NMDevice *dev, guint *bad_crypt_pac
|
|||
/* If there is a desired AP to connect to, use that essid and possible WEP key */
|
||||
if ((best_ap = nm_device_get_best_ap (dev)) && nm_ap_get_essid (best_ap))
|
||||
{
|
||||
int sk;
|
||||
struct iwreq wreq;
|
||||
|
||||
nm_device_bring_down (dev);
|
||||
|
||||
/* Force the card into Managed/Infrastructure mode */
|
||||
sk = iw_sockets_open ();
|
||||
if (sk >= 0)
|
||||
{
|
||||
int err;
|
||||
wreq.u.mode = IW_MODE_INFRA;
|
||||
err = iw_set_ext (sk, nm_device_get_iface (dev), SIOCSIWMODE, &wreq);
|
||||
if (err == -1)
|
||||
syslog (LOG_ERR, "nm_device_activate_wireless(%s): error setting card to Infrastructure mode. errno = %d", nm_device_get_iface (dev), errno);
|
||||
close (sk);
|
||||
}
|
||||
|
||||
/* Disable encryption, then re-enable and set correct key on the card
|
||||
* if we are going to encrypt traffic.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue