Browse Source

Removed trailing white spaces.

tags/1.75
Sorina Sandu Gaudenz Steinlin 9 years ago
parent
commit
761dd7b775
12 changed files with 107 additions and 107 deletions
  1. +1
    -1
      Makefile
  2. +4
    -4
      README
  3. +39
    -39
      debian/changelog
  4. +3
    -3
      debian/control
  5. +1
    -1
      debian/copyright
  6. +2
    -2
      debian/netcfg-common.templates
  7. +1
    -1
      debian/netcfg-dhcp.templates
  8. +7
    -7
      dhcp.c
  9. +3
    -3
      netcfg-common.c
  10. +2
    -2
      netcfg.c
  11. +8
    -8
      static.c
  12. +36
    -36
      wpa.c

+ 1
- 1
Makefile View File

@@ -40,7 +40,7 @@ netcfg: netcfg.o dhcp.o static.o ethtool-lite.o wpa.o wpa_ctrl.o

ethtool-lite: ethtool-lite-test.o
$(CC) -o $@ $<
ethtool-lite-test.o: ethtool-lite.c
$(CC) -c $(CFLAGS) -DTEST $(DEFS) $(INCS) -o $@ $<



+ 4
- 4
README View File

@@ -1,11 +1,11 @@
netcfg

This package is used by debian-installer to configure the network. The purpose
is two-fold:
is two-fold:

1. configure the network for the currently running kernel so that the base
system can be retrieved from the internet or a local mirror.
2. write configuration files so that when the machine reboots into the full
1. configure the network for the currently running kernel so that the base
system can be retrieved from the internet or a local mirror.
2. write configuration files so that when the machine reboots into the full
debian system the network is brought up automatically.

netcfg is written specifically for the debian-installer and probably won't work


+ 39
- 39
debian/changelog View File

@@ -82,7 +82,7 @@ netcfg (1.70) unstable; urgency=low

[ Jurij Smakov ]
* Don't try to compile wireless code on sparc, fixing FTBFS introduced
by (intentional) dropping of libiw-dev build dependency.
by (intentional) dropping of libiw-dev build dependency.

-- Jurij Smakov <jurij@debian.org> Fri, 04 Nov 2011 20:53:05 +0000

@@ -219,7 +219,7 @@ netcfg (1.61) unstable; urgency=low
[ Robert Edmonds ]
* Wait for the network to be usable before trying to use it
(in the case of STP-enabled switch for instance
Use busybox's arping with the '-f' flag (quit on first ARP reply).
Use busybox's arping with the '-f' flag (quit on first ARP reply).
Wait up to 45 seconds for an ARP reply from the default gateway
Closes: #537271

@@ -1339,7 +1339,7 @@ netcfg (1.14) unstable; urgency=high

* Update libiw build-dep and rebuild to fix crash with new version of the
library. Closes: #327390
* Updated translations:
* Updated translations:
- Danish (da.po) by Claus Hindsgaul
- Spanish (es.po) by Javier Fernández-Sanguino Peña
- Basque (eu.po) by Piarres Beobide
@@ -1390,7 +1390,7 @@ netcfg (1.13) unstable; urgency=low
* Fix error setting default value for new netcfg/dhcp_timeout template.
* Add myself to uploaders

* Updated translations:
* Updated translations:
- Czech (cs.po) by Miroslav Kure
- Danish (da.po) by Claus Hindsgaul
- German (de.po) by Holger Wansing
@@ -1429,7 +1429,7 @@ netcfg (1.12) unstable; urgency=low
* A few interface types seem to be pure product names and not translatable.
Do not mark these templates as translatable.

* Updated translations:
* Updated translations:
- Czech (cs.po) by Miroslav Kure
- French (fr.po) by Christian Perrier
- Italian (it.po) by Giuseppe Sacco
@@ -1445,10 +1445,10 @@ netcfg (1.11) unstable; urgency=low

[ Joey Hess ]
* Switch to using libiw28.
* Add a hack to sed the substvars files to get proper dependency on
* Add a hack to sed the substvars files to get proper dependency on
the libiw udeb w/o a versioned dependency on the deb.
* Updated translations:
* Updated translations:
- Catalan (ca.po) by Guillem Jover
- Greek, Modern (1453-) (el.po) by Greek Translation Team
- Basque (eu.po) by Piarres Beobide
@@ -1561,7 +1561,7 @@ netcfg (1.07.1) unstable; urgency=low
- Add a note to translators about the maximum length of
individual Choices translations for Select templates
* Includes fixes for substitutions in translated templates.
* Updated translations:
* Updated translations:
- Bosnian (bs.po) by Safir Šećerović
- Catalan (ca.po) by Jordi Mallach
- Czech (cs.po) by Miroslav Kure
@@ -1588,7 +1588,7 @@ netcfg (1.07) unstable; urgency=high
(Note: this seems to fix s:xxxxx passphrase entry.)
- Rectify some poor wording and missing examples in netcfg/wireless_wep
template.
* Updated translations:
* Updated translations:
- Arabic (ar.po) by Ossama M. Khayat
- Bulgarian (bg.po) by Ognyan Kulev
- Bosnian (bs.po) by Safir Šećerović
@@ -1635,7 +1635,7 @@ netcfg (1.06) unstable; urgency=high
- Fix substitution variables in Greek and Swedish translations.
* Joshua Kwan
- Really apply Andrew Pollock's WEP patch. closes: #262624
* Updated translations:
* Updated translations:
- Greek, Modern (1453-) (el.po) by Greek Translation Team
- Finnish (fi.po) by Tapio Lehtonen
- Hebrew (he.po) by Lior Kaplan
@@ -1653,7 +1653,7 @@ netcfg (1.05) unstable; urgency=high

* Joey Hess
- Rebuild, fixing dependencies on libiw27.
* Updated translations:
* Updated translations:
- Bulgarian (bg.po) by Ognyan Kulev

-- Joey Hess <joeyh@debian.org> Sun, 10 Oct 2004 14:55:38 -0400
@@ -1663,8 +1663,8 @@ netcfg (1.04) unstable; urgency=low
* Thiemo Seufer
- Sanitize the ifdef TEST maze in ethtool-lite.c.
* Joshua Kwan
- Remove -V option. (closes: #275096)
* Updated translations:
- Remove -V option. (closes: #275096)
* Updated translations:
- Welsh (cy.po) by Dafydd Harries
- Hebrew (he.po) by Lior Kaplan
- Hungarian (hu.po) by VEROK Istvan
@@ -1751,7 +1751,7 @@ netcfg (1.02) unstable; urgency=low
support was removed.
- Allow netcfg/choose_interface to be preseeded to just an interface name,
don't choke on the lack of a colon after it.
* Updated translations:
* Updated translations:
- Arabic (ar.po) by Ossama M. Khayat
- Bulgarian (bg.po) by Ognyan Kulev
- Bosnian (bs.po) by Safir Šećerović
@@ -1830,7 +1830,7 @@ netcfg (1.01) unstable; urgency=medium

netcfg (1.00) unstable; urgency=low

* Updated translations:
* Updated translations:
- Arabic (ar.po) by Abdulaziz Al-Arfaj
- Welsh (cy.po) by Dafydd Harries
- Danish (da.po) by Frederik Dannemare
@@ -1892,7 +1892,7 @@ netcfg (0.72) unstable; urgency=low
- Albanian (sq.po) by Elian Myftiu
- Turkish (tr.po) by Osman Yüksel
- Ukrainian (uk.po) by Eugeniy Meshcheryakov
- Simplified Chinese (zh_CN.po) by Carlos Z.F. Liu
- Simplified Chinese (zh_CN.po) by Carlos Z.F. Liu

-- Joshua Kwan <joshk@triplehelix.org> Sat, 17 Jul 2004 18:44:18 -0700

@@ -2214,14 +2214,14 @@ netcfg (0.62) unstable; urgency=low
- Prune unused #defines.
- Nuke unused netcfg/title template.
- Clarify nameserver question by adding an introductory sentence.
(Closes: #243251)
(Closes: #243251)
- Touch resolv.conf when using DHCP, to fix problems with pppoeconf
(at least for now. Closes: #241075)
* Per Olofsson
- Check for hotpluggable (PCMCIA) network interfaces in
/etc/network/devhotplug and don't generate auto entries for them.
Also put them in a "mapping hotplug" stanza. Closes: #239284.
* Updated translations:
* Updated translations:
- Czech (cs.po) by Miroslav Kure
- Danish (da.po) by Claus Hindsgaul
- Basque (eu.po) by Piarres Beobide Egaña
@@ -2254,7 +2254,7 @@ netcfg (0.61) unstable; urgency=high
- modprobe in busybox won't load af_packet. This causes DHCP
configuration fail.
This can be avoid by running modprobe without '/sbin/'.
* Updated translations:
* Updated translations:
- Welsh (cy.po) by Dafydd Harries
- German (de.po) by Alwin Meschede
- Polish (pl.po) by Bartosz Fenski
@@ -2266,7 +2266,7 @@ netcfg (0.61) unstable; urgency=high

netcfg (0.60) unstable; urgency=low

* Updated translations:
* Updated translations:
- Greek, Modern (1453-) (el.po) by Konstantinos Margaritis
- Hebrew (he.po) by Lior Kaplan
- Indonesian (id.po) by Parlin Imanuel Toh
@@ -2284,7 +2284,7 @@ netcfg (0.59) unstable; urgency=low

* Joey Hess
- Fix endian problem in gateway calculation.
* Updated translations:
* Updated translations:
- Bosnian (bs.po) by Safir Šećerović
- Catalan (ca.po) by Jordi Mallach
- Czech (cs.po) by Miroslav Kure
@@ -2310,7 +2310,7 @@ netcfg (0.58) unstable; urgency=low
* Joey Hess
- Convert netcfg/get_method, a select list, to netcfg/use_dhcp, a boolean.
This will make it easier to override at the boot prompt.
* Updated translations:
* Updated translations:
- Czech (cs.po) by Miroslav Kure
- Danish (da.po) by Claus Hindsgaul
- French (fr.po) by Philippe Batailler
@@ -2348,7 +2348,7 @@ netcfg (0.57) unstable; urgency=low
and do not ask that question a second time. Only ask it if FQDN was
_not_ passed. (Closes: #174360)
- Write out some informative text to INTERFACES_FILE.
* Updated translations:
* Updated translations:
- Danish (da.po) by Claus Hindsgaul
- French (fr.po) by Philippe Batailler
- Hungarian (hu.po) by VERÓK István
@@ -2391,7 +2391,7 @@ netcfg (0.55) unstable; urgency=low

netcfg (0.54) unstable; urgency=low

* Strip the binaries again.
* Strip the binaries again.

-- Joey Hess <joeyh@debian.org> Tue, 9 Mar 2004 15:38:56 -0500

@@ -2415,7 +2415,7 @@ netcfg (0.51) unstable; urgency=low
what DHCP is.
- Kill dhcp client before beginning static network config, to keep the
memory footprint as low as possible.
* Updated translations:
* Updated translations:
- Bulgarian (bg.po) by Ognyan Kulev
- Czech (cs.po) by Miroslav Kure
- Danish (da.po) by Claus Hindsgaul
@@ -2560,7 +2560,7 @@ netcfg (0.46) unstable; urgency=low
- Miroslav Kure
- Updated Czech translation
- Elian Myftiu
- Updated Albanian translation (sq.po)
- Updated Albanian translation (sq.po)
- Carlos Z.F. Liu
- Updated Simplified Chinese translation (zh_CN.po)
- Kenshi Muto
@@ -2745,7 +2745,7 @@ netcfg (0.37) unstable; urgency=low
* Bart Cornelis
- Merged Norwegian Bokmael (nb.po) translation from skolelinux-cvs
* Jure Cuhalev
- Added/updated slovenian translation (sl.po).
- Added/updated slovenian translation (sl.po).

-- Joey Hess <joeyh@debian.org> Tue, 23 Dec 2003 21:47:33 -0500

@@ -2825,7 +2825,7 @@ netcfg (0.34) unstable; urgency=low
- add new combined dhcp and static netcfg
(udeb netcfg)
- implement joey's dhcp idea
(wait 10s and then ask if we should try
(wait 10s and then ask if we should try
longer)
- move common code to netcfg-common.c
- improve state machines
@@ -3156,7 +3156,7 @@ netcfg (0.14) unstable; urgency=low

netcfg (0.13) unstable; urgency=low

* French templates thanks to
* French templates thanks to
Philippe Batailler <pbatailler@teaser.fr> (closes: #138073)
* some build cleanup
* tfheen: Use libdebian-installer, thanks to thomas poindessous
@@ -3179,8 +3179,8 @@ netcfg (0.12) unstable; urgency=low

netcfg (0.11) unstable; urgency=low

* use new dpkg features so build is less cludgy
* dhcp and static templates thanks to
* use new dpkg features so build is less cludgy
* dhcp and static templates thanks to
ilgiz kalmetev <i.kalmetev@bis.bashtelecom.ru>
(closes: #114843, #114844, #114845)

@@ -3188,7 +3188,7 @@ netcfg (0.11) unstable; urgency=low

netcfg (0.10) unstable; urgency=low

* fix broken handling of nameservers, build with cdebconf-dev.
* fix broken handling of nameservers, build with cdebconf-dev.

-- David Whedon <dwhedon@debian.org> Wed, 14 Feb 2001 20:33:40 -0800

@@ -3201,19 +3201,19 @@ netcfg (0.09) unstable; urgency=low

netcfg (0.08) unstable; urgency=low

* route is now in /sbin
* route is now in /sbin

-- David Whedon <dwhedon@debian.org> Wed, 31 Jan 2001 09:58:18 -0800

netcfg (0.07) unstable; urgency=low

* if a gateway is specified, netcfg-static needs to add a default route
* if a gateway is specified, netcfg-static needs to add a default route

-- David Whedon <dwhedon@debian.org> Tue, 30 Jan 2001 23:30:18 -0800

netcfg (0.06) unstable; urgency=low

* added German translations from Michael Bramer <grisu@debian.org>
* added German translations from Michael Bramer <grisu@debian.org>
(Closes: #83153, #83159)
* automatically choose between dhcp-client or pump

@@ -3222,14 +3222,14 @@ netcfg (0.06) unstable; urgency=low
netcfg (0.05) unstable; urgency=low

* added support for dhclient and pump.
* removed support for dhcpcd.
* removed support for dhcpcd.
* split things up more cleanly b/w dhcp and static.

-- David Whedon <dwhedon@debian.org> Sun, 21 Jan 2001 22:07:15 -0800

netcfg (0.04) unstable; urgency=low

* fixed a segfault found by "Randolph Chung" <randolph@tausq.org>
* fixed a segfault found by "Randolph Chung" <randolph@tausq.org>

-- David Whedon <dwhedon@gordian.com> Mon, 8 Jan 2001 19:19:17 -0800

@@ -3242,7 +3242,7 @@ netcfg (0.03) unstable; urgency=low

netcfg (0.02) unstable; urgency=low

* dhcp and static config now in two separate udebs
* dhcp and static config now in two separate udebs

-- David Whedon <dwhedon@gordian.com> Tue, 26 Dec 2000 20:53:58 -0800



+ 3
- 3
debian/control View File

@@ -16,9 +16,9 @@ Provides: configured-network
XB-Installer-Menu-Item: 1800
Description: Configure the network
To install additional installer components or the Debian Base System over
the network, you need to configure the network in the installer. This
component will first try to configure your network with DHCP and ask
you for static network configuration if this fails. The configured
the network, you need to configure the network in the installer. This
component will first try to configure your network with DHCP and ask
you for static network configuration if this fails. The configured
network settings will be copied to your newly installed system.

Package: netcfg-static


+ 1
- 1
debian/copyright View File

@@ -6,7 +6,7 @@ Authors: David Kimdon, Gaudenz Steinlin, Joey Hess, Joshua Kwan, Bastian Blank,

(If you were left out, do add yourself...)

Some code from the debian boot-floppies as well as
Some code from the debian boot-floppies as well as
Karl Hammar, Aspö Data

Copyright 2000-2004 David Kimdon <dwhedon@debian.org>


+ 2
- 2
debian/netcfg-common.templates View File

@@ -64,7 +64,7 @@ _Description: Wireless ESSID for ${iface}:

Template: netcfg/wireless_security_type
Type: select
Choices-C: wep/open, wpa
Choices-C: wep/open, wpa
__Choices: WEP/Open Network, WPA/WPA2 PSK
# :sl2:
_Description: Wireless network type for ${iface}:
@@ -174,7 +174,7 @@ Type: error
# :sl2:
_Description: No network interfaces detected
No network interfaces were found. The installation
system was unable to find a network device.
system was unable to find a network device.
.
You may need to load a specific module for your network card, if you have
one. For this, go back to the network hardware detection step.


+ 1
- 1
debian/netcfg-dhcp.templates View File

@@ -34,7 +34,7 @@ Template: netcfg/dhcp_options
Type: select
# :sl1:
# Note to translators : Please keep your translation
# below a 65 columns limit (which means 65 characters
# below a 65 columns limit (which means 65 characters
# in single-byte languages)
#flag:translate!:4
__Choices: Retry network autoconfiguration, Retry network autoconfiguration with a DHCP hostname, Configure network manually, ${wifireconf}, Do not configure the network at this time


+ 7
- 7
dhcp.c View File

@@ -415,7 +415,7 @@ int ask_wifi_configuration (struct debconfclient *client)
wifistate = (netcfg_wireless_set_essid(client, interface, "high") == GO_BACK) ?
ABORT : SECURITY_TYPE;
break;
case SECURITY_TYPE:
{
int ret;
@@ -428,7 +428,7 @@ int ask_wifi_configuration (struct debconfclient *client)
wifistate = WEP;
break;
}
case WEP:
if (wpa_supplicant_status == WPA_UNAVAIL)
wifistate = (netcfg_wireless_set_wep(client, interface) == GO_BACK) ?
@@ -437,21 +437,21 @@ int ask_wifi_configuration (struct debconfclient *client)
wifistate = (netcfg_wireless_set_wep(client, interface) == GO_BACK) ?
SECURITY_TYPE : DONE;
break;
case WPA:
wifistate = (netcfg_set_passphrase(client, interface) == GO_BACK) ?
SECURITY_TYPE : START;
break;
case START:
wifistate = (wpa_supplicant_start(client, interface, essid, passphrase) == GO_BACK) ?
ESSID : DONE;
break;
case ABORT:
return REPLY_ASK_OPTIONS;
break;
case DONE:
return REPLY_CHECK_DHCP;
break;
@@ -738,7 +738,7 @@ int read_resolv_conf_nameservers(struct in_addr array[])
{
FILE *f;
int i = 0;
if ((f = fopen(RESOLV_FILE, "r")) != NULL) {
char buf[256];



+ 3
- 3
netcfg-common.c View File

@@ -943,7 +943,7 @@ int netcfg_get_hostname(struct debconfclient *client, char *template, char **hos
*s = '\0';
}
}
if (!valid_hostname(*hostname)) {
di_info("%s is an invalid hostname", *hostname);
debconf_subst(client, "netcfg/invalid_hostname",
@@ -1288,7 +1288,7 @@ int netcfg_detect_link(struct debconfclient *client, const char *if_name)
inet_ntop(AF_INET, &gateway, s_gateway, sizeof(s_gateway));
sprintf(arping, "arping -c 1 -w 1 -f -I %s %s", if_name, s_gateway);
}
debconf_capb(client, "progresscancel");
debconf_subst(client, "netcfg/link_detect_progress", "interface", if_name);
debconf_progress_start(client, 0, 100, "netcfg/link_detect_progress");
@@ -1316,6 +1316,6 @@ int netcfg_detect_link(struct debconfclient *client, const char *if_name)

debconf_progress_stop(client);
debconf_capb(client, "backup");
return rv;
}

+ 2
- 2
netcfg.c View File

@@ -300,7 +300,7 @@ int main(int argc, char *argv[])
}

case WCONFIG_WEP:
if (netcfg_wireless_set_wep(client, interface) == GO_BACK)
if (netcfg_wireless_set_wep(client, interface) == GO_BACK)
if (wpa_supplicant_status == WPA_UNAVAIL)
state = WCONFIG_ESSID;
else
@@ -326,7 +326,7 @@ int main(int argc, char *argv[])
state = WCONFIG_ESSID;
else
state = GET_METHOD;
break;
break;

case QUIT:
netcfg_update_entropy();


+ 8
- 8
static.c View File

@@ -292,21 +292,21 @@ int netcfg_activate_static(struct debconfclient *client)

#elif defined(__FreeBSD_kernel__)
deconfigure_network();
loop_setup();
interface_up(interface);
/* Flush all previous addresses, routes */
snprintf(buf, sizeof(buf), "ifconfig %s inet 0 down", interface);
rv |= di_exec_shell_log(buf);
snprintf(buf, sizeof(buf), "ifconfig %s up", interface);
rv |= di_exec_shell_log(buf);
snprintf(buf, sizeof(buf), "ifconfig %s %s",
interface,
inet_ntop (AF_INET, &ipaddress, ptr1, sizeof (ptr1)));
/* avoid using a second buffer */
di_snprintfcat(buf, sizeof(buf), " netmask %s",
inet_ntop (AF_INET, &netmask, ptr1, sizeof (ptr1)));
@@ -314,12 +314,12 @@ int netcfg_activate_static(struct debconfclient *client)
/* avoid using a third buffer */
di_snprintfcat(buf, sizeof(buf), " broadcast %s",
inet_ntop (AF_INET, &broadcast, ptr1, sizeof (ptr1)));
di_info("executing: %s", buf);
rv |= di_exec_shell_log(buf);
if (pointopoint.s_addr) {
snprintf(buf, sizeof(buf), "route add %s",
snprintf(buf, sizeof(buf), "route add %s",
inet_ntop (AF_INET, &pointopoint, ptr1, sizeof (ptr1)));
/* avoid using a second buffer */
di_snprintfcat(buf, sizeof(buf), "%s",


+ 36
- 36
wpa.c View File

@@ -84,7 +84,7 @@ int wireless_security_type (struct debconfclient *client, char *if_name)
int netcfg_set_passphrase (struct debconfclient *client, char *if_name)
{
int ret;
debconf_subst(client, "netcfg/wireless_wpa", "iface", if_name);
debconf_input(client, "high", "netcfg/wireless_wpa");
ret = debconf_go(client);
@@ -94,7 +94,7 @@ int netcfg_set_passphrase (struct debconfclient *client, char *if_name)

if (passphrase != NULL)
free(passphrase);
debconf_get(client, "netcfg/wireless_wpa");
passphrase = strdup(client->value);

@@ -127,7 +127,7 @@ static int start_wpa_daemon(struct debconfclient *client)
di_error("could not exec wpasupplicant: %s", strerror(errno));
return 1;
}
else
else
return 0;
}
else {
@@ -149,23 +149,23 @@ static int wpa_connect(char *if_name)
{
char *cfile;
int flen, res;
flen = (strlen(WPASUPP_CTRL) + strlen(if_name) + 2);
cfile = malloc(flen);
if (cfile == NULL) {
di_info("Can't allocate memory for WPA control interface.");
return 1;
}
}
res = snprintf(cfile, flen, "%s/%s", WPASUPP_CTRL, if_name);
if ((res < 0) || (res >= flen)) {
free(cfile);
return 1;
}
}
ctrl = wpa_ctrl_open(cfile);
free(cfile);
if (ctrl == NULL) {
di_info("Couldn't connect to wpasupplicant");
return 1;
@@ -179,15 +179,15 @@ static int netcfg_wpa_cmd (char *cmd)
char buf[256];
size_t len;
int ret;
len = sizeof(buf) -1;
ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, NULL);
if (ret < 0) {
di_info("Sending %s to wpasupplicant failed", cmd);
return 1;
}
return 0;
}

@@ -197,11 +197,11 @@ static int wpa_set_ssid (char *ssid)
size_t len;
char cmd[256];
char buf[256];
res = snprintf(cmd, sizeof(cmd), "SET_NETWORK 0 %s \"%s\"", "ssid", ssid);
if (res < 0)
return 1;
len = sizeof(buf) -1;
ret = wpa_ctrl_request(ctrl, cmd, sizeof(cmd), buf, &len, NULL);
if (ret != 0) {
@@ -217,12 +217,12 @@ static int wpa_set_psk(char *passphrase)
size_t len;
char buf[256];
char cmd[256];
res = snprintf(cmd, sizeof(cmd), "SET_NETWORK 0 %s \"%s\"", "psk", passphrase);
if (res < 0)
return 1;
len = sizeof(buf) -1;
len = sizeof(buf) -1;
ret = wpa_ctrl_request(ctrl, cmd, sizeof(cmd), buf, &len, NULL);
if (ret != 0)
return 1;
@@ -236,7 +236,7 @@ static int wpa_status(void)
size_t len;
char buf[2048];
const char *success = "wpa_state=COMPLETED";
len = sizeof(buf) -1;
ret = wpa_ctrl_request(ctrl, "STATUS", 7, buf, &len, NULL);

@@ -246,7 +246,7 @@ static int wpa_status(void)
}
else
return 1;
if (strstr(buf, success) == NULL)
return 1;
else {
@@ -306,7 +306,7 @@ int poll_wpa_supplicant(struct debconfclient *client)
int wpa_supplicant_start(struct debconfclient *client, char *if_name, char *ssid, char *passphrase)
{
int retry = 0;
enum { CHECK_DAEMON,
START_DAEMON,
CONNECT,
@@ -319,10 +319,10 @@ int wpa_supplicant_start(struct debconfclient *client, char *if_name, char *ssid
POLL,
ABORT,
SUCCESS } state = CHECK_DAEMON;
for (;;) {
switch(state) {
case CHECK_DAEMON:
wpa_daemon_running();
if (wpa_is_running)
@@ -330,21 +330,21 @@ int wpa_supplicant_start(struct debconfclient *client, char *if_name, char *ssid
else
state = START_DAEMON;
break;
case START_DAEMON:
if (!start_wpa_daemon(client))
state = CONNECT;
else
state = ABORT;
break;
case CONNECT:
if (wpa_connect(if_name) == 0)
state = PING;
else
state = ABORT;
break;
case PING:
/* if the daemon doesn't respond, try and ping
* it and increment retry. If we have done
@@ -361,7 +361,7 @@ int wpa_supplicant_start(struct debconfclient *client, char *if_name, char *ssid
else
state = ADD_NETWORK;
break;
case ADD_NETWORK:
if (wpa_is_running) {
state = SET_ESSID;
@@ -372,51 +372,51 @@ int wpa_supplicant_start(struct debconfclient *client, char *if_name, char *ssid
else
state = SET_ESSID;
break;
case SET_ESSID:
if (wpa_set_ssid(ssid))
state = PING;
else
state = SET_PSK;
break;
case SET_PSK:
if (wpa_set_psk(passphrase))
state = PING;
else
state = SET_SCAN_SSID;
break;
case SET_SCAN_SSID:
if (netcfg_wpa_cmd("SET_NETWORK 0 scan_ssid 1"))
state = PING;
else
state = ENABLE_NETWORK;
break;
case ENABLE_NETWORK:
if (netcfg_wpa_cmd("ENABLE_NETWORK 0"))
state = PING;
else
state = POLL;
break;
case POLL:
if (poll_wpa_supplicant(client))
state = ABORT;
else
state = SUCCESS;
break;
case ABORT:
if (ctrl == NULL)
if (ctrl == NULL)
return GO_BACK;
else {
wpa_ctrl_close(ctrl);
ctrl = NULL;
return GO_BACK;
}
case SUCCESS:
if (ctrl == NULL)
return 0;
@@ -453,7 +453,7 @@ int netcfg_set_passphrase(struct debconfclient *client, char *if_name)
{
(void)client;
(void)if_name;
return 0;
}

@@ -463,7 +463,7 @@ int wpa_supplicant_start(struct debconfclient *client, char *if_name, char *ssid
(void)if_name;
(void)ssid;
(void)passphrase;
return 0;
}



Loading…
Cancel
Save