summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-07-19 10:56:19 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2011-07-19 10:58:24 (GMT)
commit25d62c6414a3e366e074bf0462b953f22a06828f (patch)
tree0871a0d4a8f45e2a4b6d772374b81b53d9997ce0
parent66de2f784fe4419952ef6bfc7b1f7fb8b505a193 (diff)
downloadconnman-25d62c6414a3e366e074bf0462b953f22a06828f.zip
connman-25d62c6414a3e366e074bf0462b953f22a06828f.tar.gz
connman-25d62c6414a3e366e074bf0462b953f22a06828f.tar.bz2
service: wpad only run on ipv4
-rw-r--r--src/service.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/service.c b/src/service.c
index 792c504..b8f6aac 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3635,13 +3635,34 @@ int __connman_service_indicate_default(struct connman_service *service)
return 0;
}
+static void check_proxy_setup(struct connman_service *service)
+{
+ /*
+ * We start WPAD if we haven't got a PAC URL from DHCP and
+ * if our proxy manual configuration is either empty or set
+ * to AUTO with an empty URL.
+ */
+
+ if (service->proxy != CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN)
+ return;
+
+ if (service->proxy_config != CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN &&
+ (service->proxy_config != CONNMAN_SERVICE_PROXY_METHOD_AUTO ||
+ service->pac != NULL))
+ return;
+
+ if (__connman_wpad_start(service) < 0) {
+ service->proxy = CONNMAN_SERVICE_PROXY_METHOD_DIRECT;
+ __connman_notifier_proxy_changed(service);
+ }
+}
+
int __connman_service_ipconfig_indicate_state(struct connman_service *service,
enum connman_service_state new_state,
enum connman_ipconfig_type type)
{
struct connman_ipconfig *ipconfig = NULL;
enum connman_service_state old_state;
- enum connman_service_proxy_method proxy_config;
if (service == NULL)
return -EINVAL;
@@ -3680,25 +3701,8 @@ int __connman_service_ipconfig_indicate_state(struct connman_service *service,
case CONNMAN_SERVICE_STATE_READY:
update_nameservers(service);
- proxy_config = service->proxy_config;
-
- /*
- * We start WPAD if we haven't got a PAC URL from DHCP and
- * if our proxy manual configuration is either empty or set
- * to AUTO with an empty URL.
- */
- if (service->proxy == CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN &&
- (proxy_config == CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN ||
- (proxy_config ==
- CONNMAN_SERVICE_PROXY_METHOD_AUTO &&
- service->pac == NULL)))
- if (__connman_wpad_start(service) < 0) {
- service->proxy =
- CONNMAN_SERVICE_PROXY_METHOD_DIRECT;
-
- __connman_notifier_proxy_changed(service);
- }
-
+ if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+ check_proxy_setup(service);
break;
case CONNMAN_SERVICE_STATE_ONLINE:
break;