summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-06-04 13:45:06 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-06-14 15:06:17 +0300
commit227bdf02f63fa348f6ebd30ac7fe005b396cdc4f (patch)
tree434fe602c5e2864591210460afeb649a50cbf94a /src
parent9fcc640425c7dcaf4090a86ec3ce64d7eef6b347 (diff)
downloadconnman-227bdf02f63fa348f6ebd30ac7fe005b396cdc4f.tar.gz
connman-227bdf02f63fa348f6ebd30ac7fe005b396cdc4f.tar.bz2
connman-227bdf02f63fa348f6ebd30ac7fe005b396cdc4f.zip
timeserver: Simplify timeserver IP address checking
Diffstat (limited to 'src')
-rw-r--r--src/timeserver.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/timeserver.c b/src/timeserver.c
index 2601d363..e218fe26 100644
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -115,9 +115,6 @@ static void resolv_result(GResolvResultStatus status, char **results, gpointer u
void __connman_timeserver_sync_next()
{
char *server;
- int ret;
- struct addrinfo hints;
- struct addrinfo *addr;
__connman_ntp_stop();
@@ -129,15 +126,8 @@ void __connman_timeserver_sync_next()
ts_list = g_slist_delete_link(ts_list, ts_list);
- memset(&hints, 0, sizeof(struct addrinfo));
- hints.ai_flags = AI_NUMERICHOST;
- addr = NULL;
-
- ret = getaddrinfo(server, NULL, &hints, &addr);
- freeaddrinfo(addr);
-
/* if its a IP , directly query it. */
- if (ret == 0) {
+ if (connman_inet_check_ipaddress(server) > 0) {
DBG("Using timeservers %s", server);
__connman_ntp_start(server);