summaryrefslogtreecommitdiff
path: root/src/6to4.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@nokia.com>2011-03-25 15:03:18 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-25 14:46:15 +0100
commit7370e6d24a9a15053045026755a51965a804599a (patch)
tree7f10db2c876e855bd92d173e43e704aff09ed30f /src/6to4.c
parent913260d2ee5f1d5b18b6eb4a258abd071b50adff (diff)
downloadconnman-7370e6d24a9a15053045026755a51965a804599a.tar.gz
connman-7370e6d24a9a15053045026755a51965a804599a.tar.bz2
connman-7370e6d24a9a15053045026755a51965a804599a.zip
6to4: Check if the 6to4 tunnel is active or not.
Diffstat (limited to 'src/6to4.c')
-rw-r--r--src/6to4.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/6to4.c b/src/6to4.c
index e6815a0e..3877bfbd 100644
--- a/src/6to4.c
+++ b/src/6to4.c
@@ -540,3 +540,23 @@ void __connman_6to4_remove(struct connman_ipconfig *ip4config)
if (tunnel_created)
tunnel_destroy();
}
+
+int __connman_6to4_check(struct connman_ipconfig *ip4config)
+{
+ const char *address;
+
+ if (ip4config == NULL || tunnel_created == 0 ||
+ tunnel_pending == 1)
+ return -1;
+
+ DBG("tunnel ip address %s", tunnel_ip_address);
+
+ address = __connman_ipconfig_get_local(ip4config);
+ if (address == NULL)
+ return -1;
+
+ if (g_strcmp0(address, tunnel_ip_address) == 0)
+ return 1;
+
+ return 0;
+}