summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaesub kim <taesub.kim@samsung.com>2017-03-28 09:30:43 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2017-03-28 09:30:44 (GMT)
commitc2c9cce85662ea996bedbc4a986a20b7a83cc745 (patch)
treea807934bcf004322c1fd5a78ddfe81c8266236f8
parentb66e94f65d745a5ddd24a68bf68d91186aa320d7 (diff)
parentecd2497d0cde6e54ac592734bf79e32191ce086d (diff)
downloadconnman-c2c9cce85662ea996bedbc4a986a20b7a83cc745.zip
connman-c2c9cce85662ea996bedbc4a986a20b7a83cc745.tar.gz
connman-c2c9cce85662ea996bedbc4a986a20b7a83cc745.tar.bz2
Merge "Fix to prevent RA message processing" into tizen
-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 c8e0ab0..7c44d1c 100755
--- a/src/connman.h
+++ b/src/connman.h
@@ -675,6 +675,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);
@@ -909,11 +918,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 5f5cea5..b7d7f37 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 ed3235c..035930b 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)
{