Skip to content

Commit

Permalink
gsupplicant: Use uint32 instead of string for wep_tx_keyidx
Browse files Browse the repository at this point in the history
We use a string to pass the WEP key index value, but wpa_supplicant's
DBUS API expects a uint32. In addition, wpa_supplicant wraps strings
into double quotes, which always returns 0 when wpa_supplicant tries
to extract an integer value from it with atoi(). For this particular
case, 0 happens to be the value we want.

Fix this so that we use the correct type.
  • Loading branch information
lucacoelho authored and pfl committed Aug 27, 2013
1 parent 26ada06 commit 8e4b5d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gsupplicant/supplicant.c
Expand Up @@ -3053,7 +3053,7 @@ static void add_network_security_wep(DBusMessageIter *dict,
GSupplicantSSID *ssid)
{
const char *auth_alg = "OPEN SHARED";
const char *key_index = "0";
dbus_uint32_t key_index = 0;

supplicant_dbus_dict_append_basic(dict, "auth_alg",
DBUS_TYPE_STRING, &auth_alg);
Expand Down Expand Up @@ -3101,7 +3101,7 @@ static void add_network_security_wep(DBusMessageIter *dict,
&ssid->passphrase);

supplicant_dbus_dict_append_basic(dict, "wep_tx_keyidx",
DBUS_TYPE_STRING, &key_index);
DBUS_TYPE_UINT32, &key_index);
}
}

Expand Down

0 comments on commit 8e4b5d7

Please sign in to comment.