Browse Source

Fix the GO_BACK interaction between ESSID and WEP configuratoin.

r15275
tags/0.64
Joshua Kwan 17 years ago
parent
commit
bf557b9f2a
4 changed files with 41 additions and 31 deletions
  1. +1
    -0
      debian/changelog
  2. +14
    -9
      netcfg-dhcp.c
  3. +14
    -10
      netcfg-static.c
  4. +12
    -12
      netcfg.c

+ 1
- 0
debian/changelog View File

@@ -4,6 +4,7 @@ netcfg (0.64) UNRELEASED; urgency=low
- Split out all functions into static.c, dhcp.c, wireless.c.
- Port wireless fixes back to netcfg-static and netcfg-dhcp, which
have been rather neglected lately.
- Fix the GO_BACK interaction between WEP and ESSID configuration.
- Write loopback all the time, even when you abort network config.
(Closes: #248636)
- Redesign DHCP strategy with a new template that uses a select,


+ 14
- 9
netcfg-dhcp.c View File

@@ -41,7 +41,7 @@ int main(void)
static struct debconfclient *client;
static int requested_wireless_tools = 0;

enum { BACKUP, GET_INTERFACE, WCONFIG, QUIT } state = GET_INTERFACE;
enum { BACKUP, GET_INTERFACE, WCONFIG, WCONFIG_WEP, WCONFIG_ESSID, QUIT } state = GET_INTERFACE;

wfd = iw_sockets_open();

@@ -73,18 +73,23 @@ int main(void)
requested_wireless_tools = 1;
di_exec_shell("apt-install wireless-tools");
}
state = WCONFIG_ESSID;
break;

case WCONFIG_ESSID:
if (netcfg_wireless_set_essid (client, interface))
{
state = BACKUP;
break;
}
else
state = WCONFIG_WEP;
break;

case WCONFIG_WEP:
if (netcfg_wireless_set_wep (client, interface))
{
state = BACKUP;
break;
}
state = QUIT;
state = WCONFIG_ESSID;
else
state = QUIT;
break;

case QUIT:
switch (netcfg_activate_dhcp(client)) {
case 0:


+ 14
- 10
netcfg-static.c View File

@@ -38,8 +38,7 @@ int main(void)
static struct debconfclient *client;
static int requested_wireless_tools = 0;

enum { BACKUP, GET_INTERFACE, GET_STATIC, WCONFIG, QUIT} state = GET_INTERFACE;

enum { BACKUP, GET_INTERFACE, GET_STATIC, WCONFIG, WCONFIG_ESSID, WCONFIG_WEP, QUIT} state = GET_INTERFACE;

/* initialize libd-i */
di_system_init("netcfg-static");
@@ -75,18 +74,23 @@ int main(void)
requested_wireless_tools = 1;
di_exec_shell("apt-install wireless-tools");
}
state = WCONFIG_ESSID;
break;

case WCONFIG_ESSID:
if (netcfg_wireless_set_essid (client, interface))
{
state = BACKUP;
break;
}
else
state = WCONFIG_WEP;
break;

case WCONFIG_WEP:
if (netcfg_wireless_set_wep (client, interface))
{
state = BACKUP;
break;
}
state = GET_STATIC;
state = WCONFIG_ESSID;
else
state = GET_STATIC;
break;

case QUIT:
if (netcfg_activate_static(client) != 0)
return 1;


+ 12
- 12
netcfg.c View File

@@ -62,7 +62,7 @@ response_t netcfg_get_method(struct debconfclient *client)
int main(void)
{
int num_interfaces = 0;
enum { BACKUP, GET_INTERFACE, GET_METHOD, GET_DHCP, GET_STATIC, WCONFIG, QUIT } state = GET_INTERFACE;
enum { BACKUP, GET_INTERFACE, GET_METHOD, GET_DHCP, GET_STATIC, WCONFIG, WCONFIG_ESSID, WCONFIG_WEP, QUIT } state = GET_INTERFACE;
static struct debconfclient *client;
static int requested_wireless_tools = 0;
response_t res;
@@ -146,21 +146,21 @@ int main(void)
di_exec_shell_log("apt-install wireless-tools");
requested_wireless_tools = 1;
}
/* Must make sure WEP question is always asked, independent
* of whether set essid question was asked. */
state = WCONFIG_ESSID;
break;

case WCONFIG_ESSID:
if (netcfg_wireless_set_essid (client, interface) == GO_BACK)
{
state = BACKUP;
break;
}
else
state = WCONFIG_WEP;
break;
case WCONFIG_WEP:
if (netcfg_wireless_set_wep (client, interface) == GO_BACK)
{
state = BACKUP;
break;
}
state = GET_METHOD;
state = WCONFIG_ESSID;
else
state = GET_METHOD;
break;

case QUIT:


Loading…
Cancel
Save