summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/connman.h14
-rwxr-xr-xsrc/rtnl.c40
-rwxr-xr-xsrc/service.c29
3 files changed, 52 insertions, 31 deletions
diff --git a/src/connman.h b/src/connman.h
index 499f38db..ee127e7f 100755
--- a/src/connman.h
+++ b/src/connman.h
@@ -670,6 +670,15 @@ int __connman_service_load_modifiable(struct connman_service *service);
void __connman_service_list_struct(DBusMessageIter *iter);
+#if defined TIZEN_EXT
+int connman_service_get_ipv6_dns_method(struct connman_service *service);
+enum connman_dnsconfig_method {
+ CONNMAN_DNSCONFIG_METHOD_UNKNOWN = 0,
+ CONNMAN_DNSCONFIG_METHOD_MANUAL = 1,
+ CONNMAN_DNSCONFIG_METHOD_DHCP = 2,
+};
+#endif
+
struct connman_service *__connman_service_lookup_from_index(int index);
struct connman_service *__connman_service_lookup_from_ident(const char *identifier);
struct connman_service *__connman_service_create_from_network(struct connman_network *network);
@@ -904,11 +913,6 @@ unsigned int __connman_rtnl_update_interval_remove(unsigned int interval);
int __connman_rtnl_request_update(void);
int __connman_rtnl_send(const void *buf, size_t len);
-#if defined TIZEN_EXT
-void rtnl_nameserver_add_all(struct connman_service *service,
- enum connman_ipconfig_type type);
-#endif
-
bool __connman_session_policy_autoconnect(enum connman_service_connect_reason reason);
int __connman_session_create(DBusMessage *msg);
diff --git a/src/rtnl.c b/src/rtnl.c
index 5f5cea57..b7d7f375 100755
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -1314,6 +1314,34 @@ static void rtnl_newnduseropt(struct nlmsghdr *hdr)
if (index < 0)
return;
+#if defined TIZEN_EXT
+ struct connman_service *service;
+ enum connman_dnsconfig_method ipv6_dns_method;
+ char *ifname;
+
+ service = __connman_service_lookup_from_index(index);
+ if (!service || !(__connman_service_index_is_default(index))) {
+ DBG("Invalid service, index: %d\n", index);
+ return;
+ }
+
+ DBG("service: %p index: %d\n", service, index);
+
+ ifname = connman_inet_ifname(index);
+ if (ifname == NULL) {
+ DBG("Interface is NULL, return");
+ return;
+ }
+
+ ipv6_dns_method = connman_service_get_ipv6_dns_method(service);
+ if (ipv6_dns_method != CONNMAN_DNSCONFIG_METHOD_DHCP) {
+ DBG("IPv6 DNS method is not Auto ignore RA!!! [DNS method: %d]", ipv6_dns_method);
+ g_free(ifname);
+ return;
+ }
+ g_free(ifname);
+#endif
+
for (opt = (void *)&msg[1];
msglen > 0;
msglen -= opt->nd_opt_len * 8,
@@ -1324,12 +1352,7 @@ static void rtnl_newnduseropt(struct nlmsghdr *hdr)
if (opt->nd_opt_type == 25) { /* ND_OPT_RDNSS */
char buf[40];
-#if defined TIZEN_EXT
- struct connman_service *service;
- service = __connman_service_lookup_from_index(index);
- DBG("service: %p\n",service);
-#endif
servers = rtnl_nd_opt_rdnss(opt, &lifetime,
&nr_servers);
for (i = 0; i < nr_servers; i++) {
@@ -1338,6 +1361,9 @@ static void rtnl_newnduseropt(struct nlmsghdr *hdr)
continue;
#if defined TIZEN_EXT
+ __connman_service_nameserver_remove(service,
+ buf, false,
+ CONNMAN_IPCONFIG_TYPE_IPV6);
__connman_service_nameserver_append(service,
buf, false,
CONNMAN_IPCONFIG_TYPE_IPV6);
@@ -1345,10 +1371,6 @@ static void rtnl_newnduseropt(struct nlmsghdr *hdr)
connman_resolver_append_lifetime(index,
NULL, buf, lifetime);
}
-#if defined TIZEN_EXT
- rtnl_nameserver_add_all(service, CONNMAN_IPCONFIG_TYPE_IPV6);
-#endif
-
} else if (opt->nd_opt_type == 31) { /* ND_OPT_DNSSL */
g_free(domains);
diff --git a/src/service.c b/src/service.c
index ed3235c1..035930bf 100755
--- a/src/service.c
+++ b/src/service.c
@@ -77,14 +77,6 @@ struct connman_service_user {
uid_t current_user;
};
-#ifdef TIZEN_EXT
-enum connman_dnsconfig_method {
- CONNMAN_DNSCONFIG_METHOD_UNKNOWN = 0,
- CONNMAN_DNSCONFIG_METHOD_MANUAL = 1,
- CONNMAN_DNSCONFIG_METHOD_DHCP = 2,
-};
-#endif
-
struct connman_service {
int refcount;
char *identifier;
@@ -1643,15 +1635,6 @@ static int nameserver_remove_all(struct connman_service *service)
return 0;
}
-#if defined TIZEN_EXT
-void rtnl_nameserver_add_all(struct connman_service *service,
- enum connman_ipconfig_type type)
-{
- DBG("");
- nameserver_add_all(service, type);
-}
-#endif
-
static int searchdomain_add_all(struct connman_service *service)
{
int index, i = 0;
@@ -3657,6 +3640,18 @@ const char *connman_service_get_proxy_autoconfig(struct connman_service *service
return NULL;
}
+#if defined TIZEN_EXT
+int connman_service_get_ipv6_dns_method(struct connman_service *service)
+{
+ if (!service) {
+ DBG("Service is NULL");
+ return -1;
+ }
+
+ return service->dns_config_method_ipv6;
+}
+#endif
+
void __connman_service_set_timeservers(struct connman_service *service,
char **timeservers)
{