Browse Source

lots of nice fixes for #234412

r10902
tags/0.58
Joshua Kwan [obsolete] 17 years ago
parent
commit
517f56eac5
4 changed files with 46 additions and 16 deletions
  1. +4
    -1
      debian/changelog
  2. +30
    -13
      netcfg-common.c
  3. +10
    -2
      netcfg.c
  4. +2
    -0
      netcfg.h

+ 4
- 1
debian/changelog View File

@@ -7,11 +7,14 @@ netcfg (0.57) UNRELEASED; urgency=low
instead of using well tested default functions?
- Only recalculate gateway if ipaddress or netmask is changed.
- Never recalculate nameserver.
* Joshua Kwan
- Make the question about adhoc/managed actually do something.
- Make sure the WEP question, priority high, always gets asked.
* Translators: do not modify this changelog to record changes you make to
po files. A record of your contributions will be added to the changelog
at package release time by the output-l10n-changes program.

-- Jure Cuhalev <gandalf@a1200.rozica.com> Mon, 15 Mar 2004 00:40:00 +0100
-- Joshua Kwan <joshk@triplehelix.org> Tue, 16 Mar 2004 21:17:25 -0800

netcfg (0.56) unstable; urgency=low



+ 30
- 13
netcfg-common.c View File

@@ -673,6 +673,9 @@ static int netcfg_write_static(char *prebaseconfig, char *domain,
{
if (essid != NULL)
fprintf(fp, "\twireless_essid %s\n", essid);
else /* Some cards need an explicit set to 'any' */
fprintf(fp, "\twireless_essid any\n");

if (wepkey != NULL)
fprintf(fp, "\twireless_key %s\n", wepkey);
}
@@ -1127,29 +1130,36 @@ int netcfg_wireless_set_essid (struct debconfclient * client, char *iface)
debconf_subst(client, "netcfg/wireless_essid", "iface", iface);
debconf_subst(client, "netcfg/wireless_adhoc_managed", "iface", iface);

ret = my_debconf_input(client, "low", "netcfg/wireless_adhoc_managed", &tf);
ret = debconf_input(client, "low", "netcfg/wireless_adhoc_managed");

if (ret == 30)
return ret;
return NOT_ASKED;

if (debconf_go(client))
return GO_BACK;

if (!strcmp(tf, "Ad-hoc network (Peer to peer)"))
debconf_get(client, "netcfg/wireless_adhoc_managed");

if (!strcmp(client->value, "Ad-hoc network (Peer to peer)"))
mode = ADHOC;

tf = NULL;
wconf.has_mode = 1;
wconf.mode = (mode == ADHOC) ? 1 : 2;
ret = my_debconf_input(client, "low", "netcfg/wireless_essid", &tf);

if (ret == 30)
return ret;
debconf_input(client, "low", "netcfg/wireless_essid");
if (debconf_go(client) == 30)
return GO_BACK;
debconf_get(client, "netcfg/wireless_essid");
tf = client->value;
/* question not asked or user doesn't care or we're successfully associated */
if (!empty_str(wconf.essid) || empty_str(tf))
if (!empty_str(wconf.essid) || empty_str(client->value))
{
/* Default to mode managed, AP any */
/* Default to any AP */
wconf.essid[0] = '\0';
wconf.essid_on = 0;
wconf.has_mode = 1;
wconf.mode = 2; /* MANAGED */

iw_set_basic_config (wfd, iface, &wconf);
@@ -1170,8 +1180,15 @@ int netcfg_wireless_set_essid (struct debconfclient * client, char *iface)
debconf_input(client, "high", "netcfg/invalid_essid");
debconf_go(client);
ret = my_debconf_input(client, "low", "netcfg/wireless_essid", &user_essid);
ret = debconf_input(client, "low", "netcfg/wireless_essid");
/* we asked the question once, why can't we ask it again? */
assert (ret != 30);
if (debconf_go(client) == 30) /* well, we did, but he wants to go back */
return GO_BACK;

debconf_get(client, "netcfg/wireless_essid");
user_essid = client->value;
}

essid = strdup (user_essid);


+ 10
- 2
netcfg.c View File

@@ -123,12 +123,20 @@ int main(void)
di_exec_shell_log("apt-install wireless-tools");
requested_wireless_tools = 1;
}
if (netcfg_wireless_set_essid (client, interface) == 30
|| netcfg_wireless_set_wep (client, interface) == 30)
/* Must make sure WEP question is always asked, independent
* of whether set essid question was asked. */
if (netcfg_wireless_set_essid (client, interface) == GO_BACK)
{
state = BACKUP;
break;
}
if (netcfg_wireless_set_wep (client, interface) == GO_BACK)
{
state = BACKUP;
break;
}
state = GET_METHOD;
break;
case QUIT:


+ 2
- 0
netcfg.h View File

@@ -18,6 +18,8 @@

#define _GNU_SOURCE

enum { NOT_ASKED = 30, GO_BACK };

extern int netcfg_progress_displayed;
extern int wfd;



Loading…
Cancel
Save