summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-04-21 18:08:08 +0000
committerOlivier Blin <oblin@mandriva.org>2005-04-21 18:08:08 +0000
commit60bb9a7941e9cf4a8756a8f5ae221b03eaeebc5c (patch)
tree5e4f955ec2b86a9f2901c907b82c8c23a9de3d39 /mdk-stage1
parent92e8dd248fc64a6f80bf3f49444d5ded338bdda7 (diff)
downloaddrakx-60bb9a7941e9cf4a8756a8f5ae221b03eaeebc5c.tar
drakx-60bb9a7941e9cf4a8756a8f5ae221b03eaeebc5c.tar.gz
drakx-60bb9a7941e9cf4a8756a8f5ae221b03eaeebc5c.tar.bz2
drakx-60bb9a7941e9cf4a8756a8f5ae221b03eaeebc5c.tar.xz
drakx-60bb9a7941e9cf4a8756a8f5ae221b03eaeebc5c.zip
set SSID after all other settings, improve text, fix cast
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/wireless.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/mdk-stage1/wireless.c b/mdk-stage1/wireless.c
index 1785dbfa7..c241bd662 100644
--- a/mdk-stage1/wireless.c
+++ b/mdk-stage1/wireless.c
@@ -96,7 +96,7 @@ static int wireless_set_restricted_key(int socket, const char *ifname, const cha
unsigned int tmp;
while (sscanf(key + 2*key_len, "%2X", &tmp) == 1)
- real_key[key_len++] = (unsigned char) tmp;
+ real_key[key_len++] = (char) tmp;
wrq.u.data.flags = IW_ENCODE_RESTRICTED;
wrq.u.data.pointer = (char *) real_key;
@@ -119,7 +119,9 @@ enum return_type configure_wireless(const char *ifname)
return RETURN_OK;
}
- results = ask_from_entries_auto("Please enter your wireless settings.",
+ results = ask_from_entries_auto("Please enter your wireless settings. "
+ "The ESSID is your wireless network identifier. "
+ "The WEP key must be entered in hexadecimal, without any separator.",
questions, &answers, 32, questions_auto, NULL);
if (results != RETURN_OK) {
wireless_close_socket(wsock);
@@ -132,12 +134,6 @@ enum return_type configure_wireless(const char *ifname)
return RETURN_ERROR;
}
- log_message("setting ESSID \"%s\" on device \"%s\"", answers[0], ifname);
- if (!wireless_set_essid(wsock, ifname, answers[0])) {
- stg1_error_message("unable to set ESSID \"%s\" on device \"%s\": %s", answers[0], ifname, strerror(errno));
- return RETURN_ERROR;
- }
-
if (answers[1] && !streq(answers[1], "")) {
log_message("setting WEP key \"%s\" on device \"%s\"", answers[1], ifname);
if (!wireless_set_restricted_key(wsock, ifname, answers[1])) {
@@ -152,6 +148,13 @@ enum return_type configure_wireless(const char *ifname)
}
}
+ /* most devices perform discovery when ESSID is set, it needs to be last */
+ log_message("setting ESSID \"%s\" on device \"%s\"", answers[0], ifname);
+ if (!wireless_set_essid(wsock, ifname, answers[0])) {
+ stg1_error_message("unable to set ESSID \"%s\" on device \"%s\": %s", answers[0], ifname, strerror(errno));
+ return RETURN_ERROR;
+ }
+
wireless_close_socket(wsock);
return RETURN_OK;
}