aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/main_winsvc.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-12-24 18:39:32 (GMT)
committerJouni Malinen <j@w1.fi>2008-12-24 18:39:32 (GMT)
commitf44b6b8c049552d78a7db14b7ab409abddd072e0 (patch)
treee13d0c337cf79d3f50600a0047a984fa7c52c93e /wpa_supplicant/main_winsvc.c
parent4b4a8ae547f409b17154722b3240915ed5eceecb (diff)
downloadhostap-f44b6b8c049552d78a7db14b7ab409abddd072e0.zip
hostap-f44b6b8c049552d78a7db14b7ab409abddd072e0.tar.gz
hostap-f44b6b8c049552d78a7db14b7ab409abddd072e0.tar.bz2
wpasvc: Add skip_on_error registry value to skip interfaces on error
This can be used to include binding information for multiple interfaces in Windows registry and only use the ones that match with an available network interface.
Diffstat (limited to 'wpa_supplicant/main_winsvc.c')
-rw-r--r--wpa_supplicant/main_winsvc.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/wpa_supplicant/main_winsvc.c b/wpa_supplicant/main_winsvc.c
index 6d416fd..4b072fc 100644
--- a/wpa_supplicant/main_winsvc.c
+++ b/wpa_supplicant/main_winsvc.c
@@ -70,9 +70,10 @@ static int read_interface(struct wpa_global *global, HKEY _hk,
HKEY hk;
#define TBUFLEN 255
TCHAR adapter[TBUFLEN], config[TBUFLEN], ctrl_interface[TBUFLEN];
- DWORD buflen;
+ DWORD buflen, val;
LONG ret;
struct wpa_interface iface;
+ int skip_on_error = 0;
ret = RegOpenKeyEx(_hk, name, 0, KEY_QUERY_VALUE, &hk);
if (ret != ERROR_SUCCESS) {
@@ -116,10 +117,21 @@ static int read_interface(struct wpa_global *global, HKEY _hk,
iface.confname = (char *) config;
}
+ buflen = sizeof(val);
+ ret = RegQueryValueEx(hk, TEXT("skip_on_error"), NULL, NULL,
+ (LPBYTE) &val, &buflen);
+ if (ret == ERROR_SUCCESS && buflen == sizeof(val))
+ skip_on_error = val;
+
RegCloseKey(hk);
- if (wpa_supplicant_add_iface(global, &iface) == NULL)
- return -1;
+ if (wpa_supplicant_add_iface(global, &iface) == NULL) {
+ if (skip_on_error)
+ wpa_printf(MSG_DEBUG, "Skipped interface '%s' due to "
+ "initialization failure", iface.ifname);
+ else
+ return -1;
+ }
return 0;
}