DA: Add exception check for time logic
[platform/upstream/connman.git] / src / ipv6pd.c
old mode 100644 (file)
new mode 100755 (executable)
index 5ecda38..8cd2a33
@@ -41,7 +41,6 @@ static guint timer_uplink;
 static guint timer_ra;
 static char *default_interface;
 static GSList *prefixes;
-static GHashTable *timer_hash;
 static void *rs_context;
 
 static int setup_prefix_delegation(struct connman_service *service);
@@ -139,7 +138,7 @@ static gboolean do_setup(gpointer data)
        if (!default_interface)
                DBG("No uplink connection, retrying prefix delegation");
 
-       ret = setup_prefix_delegation(__connman_service_get_default());
+       ret = setup_prefix_delegation(connman_service_get_default());
        if (ret < 0 && ret != -EINPROGRESS)
                return TRUE; /* delegation error, try again */
 
@@ -155,7 +154,7 @@ static void dhcpv6_renew_callback(struct connman_network *network,
        if (status == CONNMAN_DHCPV6_STATUS_SUCCEED)
                dhcpv6_callback(network, status, data);
        else
-               setup_prefix_delegation(__connman_service_get_default());
+               setup_prefix_delegation(connman_service_get_default());
 }
 
 static void cleanup(void)
@@ -165,9 +164,6 @@ static void cleanup(void)
                timer_uplink = 0;
        }
 
-       g_hash_table_destroy(timer_hash);
-       timer_hash = NULL;
-
        if (prefixes) {
                g_slist_free_full(prefixes, g_free);
                prefixes = NULL;
@@ -258,13 +254,6 @@ static int setup_prefix_delegation(struct connman_service *service)
        return err;
 }
 
-static void cleanup_timer(gpointer user_data)
-{
-       guint timer = GPOINTER_TO_UINT(user_data);
-
-       g_source_remove(timer);
-}
-
 static void update_default_interface(struct connman_service *service)
 {
        setup_prefix_delegation(service);
@@ -273,7 +262,7 @@ static void update_default_interface(struct connman_service *service)
 static void update_ipconfig(struct connman_service *service,
                                struct connman_ipconfig *ipconfig)
 {
-       if (!service || service != __connman_service_get_default())
+       if (!service || service != connman_service_get_default())
                return;
 
        if (ipconfig != __connman_service_get_ip6config(service))
@@ -306,7 +295,7 @@ static void update_ipconfig(struct connman_service *service,
        }
 }
 
-static struct connman_notifier pd_notifier = {
+static const struct connman_notifier pd_notifier = {
        .name                   = "IPv6 prefix delegation",
        .default_changed        = update_default_interface,
        .ipconfig_changed       = update_ipconfig,
@@ -331,16 +320,13 @@ int __connman_ipv6pd_setup(const char *bridge)
 
        bridge_index = connman_inet_ifindex(bridge);
 
-       timer_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal,
-                                               NULL, cleanup_timer);
-
        err = __connman_inet_ipv6_start_recv_rs(bridge_index, rs_received,
                                                NULL, &rs_context);
        if (err < 0)
                DBG("Cannot receive router solicitation %d/%s",
                        err, strerror(-err));
 
-       service = __connman_service_get_default();
+       service = connman_service_get_default();
        if (service) {
                /*
                 * We have an uplink connection already, try to use it.