summaryrefslogtreecommitdiff
path: root/src/ipconfig.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-07-08 02:21:43 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-07-08 02:26:03 +0200
commit3ce93388b0f7a092f5855ac37db8fb30cf0c453e (patch)
tree2b8aeeef525552a3090b6e3e73ff4b30058b6b4e /src/ipconfig.c
parent0899842f2a3323670af591d04747df472422b614 (diff)
downloadconnman-3ce93388b0f7a092f5855ac37db8fb30cf0c453e.tar.gz
connman-3ce93388b0f7a092f5855ac37db8fb30cf0c453e.tar.bz2
connman-3ce93388b0f7a092f5855ac37db8fb30cf0c453e.zip
ipconfig: Don't call IP bound ops when type does not match
Diffstat (limited to 'src/ipconfig.c')
-rw-r--r--src/ipconfig.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c
index 454d5d52..9f73b656 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -708,6 +708,7 @@ void __connman_ipconfig_newaddr(int index, int family, const char *label,
{
struct connman_ipdevice *ipdevice;
struct connman_ipaddress *ipaddress;
+ enum connman_ipconfig_type type;
GList *list;
DBG("index %d", index);
@@ -729,6 +730,13 @@ void __connman_ipconfig_newaddr(int index, int family, const char *label,
return;
}
+ if (family == AF_INET)
+ type = CONNMAN_IPCONFIG_TYPE_IPV4;
+ else if (family == AF_INET6)
+ type = CONNMAN_IPCONFIG_TYPE_IPV6;
+ else
+ return;
+
ipdevice->address_list = g_slist_append(ipdevice->address_list,
ipaddress);
@@ -755,6 +763,9 @@ void __connman_ipconfig_newaddr(int index, int family, const char *label,
if (index != ipconfig->index)
continue;
+ if (type != ipconfig->type)
+ continue;
+
if (ipconfig->ops == NULL)
continue;
@@ -768,6 +779,7 @@ void __connman_ipconfig_deladdr(int index, int family, const char *label,
{
struct connman_ipdevice *ipdevice;
struct connman_ipaddress *ipaddress;
+ enum connman_ipconfig_type type;
GList *list;
DBG("index %d", index);
@@ -780,6 +792,13 @@ void __connman_ipconfig_deladdr(int index, int family, const char *label,
if (ipaddress == NULL)
return;
+ if (family == AF_INET)
+ type = CONNMAN_IPCONFIG_TYPE_IPV4;
+ else if (family == AF_INET6)
+ type = CONNMAN_IPCONFIG_TYPE_IPV6;
+ else
+ return;
+
ipdevice->address_list = g_slist_remove(ipdevice->address_list,
ipaddress);
@@ -802,6 +821,9 @@ void __connman_ipconfig_deladdr(int index, int family, const char *label,
if (index != ipconfig->index)
continue;
+ if (type != ipconfig->type)
+ continue;
+
if (ipconfig->ops == NULL)
continue;
@@ -825,8 +847,10 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope,
g_strcmp0(dst, "::") == 0)) {
GSList *list;
GList *config_list;
+ enum connman_ipconfig_type type;
if (family == AF_INET6) {
+ type = CONNMAN_IPCONFIG_TYPE_IPV6;
g_free(ipdevice->ipv6_gateway);
ipdevice->ipv6_gateway = g_strdup(gateway);
@@ -837,6 +861,7 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope,
g_strdup(gateway);
}
} else if (family == AF_INET) {
+ type = CONNMAN_IPCONFIG_TYPE_IPV4;
g_free(ipdevice->ipv4_gateway);
ipdevice->ipv4_gateway = g_strdup(gateway);
@@ -863,6 +888,9 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope,
if (index != ipconfig->index)
continue;
+ if (type != ipconfig->type)
+ continue;
+
if (ipconfig->ops == NULL)
continue;
@@ -891,8 +919,10 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope,
g_strcmp0(dst, "::") == 0)) {
GSList *list;
GList *config_list;
+ enum connman_ipconfig_type type;
if (family == AF_INET6) {
+ type = CONNMAN_IPCONFIG_TYPE_IPV6;
g_free(ipdevice->ipv6_gateway);
ipdevice->ipv6_gateway = NULL;
@@ -902,6 +932,7 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope,
ipdevice->config_ipv6->system->gateway = NULL;
}
} else if (family == AF_INET) {
+ type = CONNMAN_IPCONFIG_TYPE_IPV4;
g_free(ipdevice->ipv4_gateway);
ipdevice->ipv4_gateway = NULL;
@@ -927,6 +958,9 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope,
if (index != ipconfig->index)
continue;
+ if (type != ipconfig->type)
+ continue;
+
if (ipconfig->ops == NULL)
continue;