diff options
Diffstat (limited to 'src/ipv6pd.c')
-rwxr-xr-x | src/ipv6pd.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/ipv6pd.c b/src/ipv6pd.c index 0d221f07..8cd2a33e 100755 --- a/src/ipv6pd.c +++ b/src/ipv6pd.c @@ -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,11 +164,6 @@ static void cleanup(void) timer_uplink = 0; } - if (timer_hash) { - g_hash_table_destroy(timer_hash); - timer_hash = NULL; - } - if (prefixes) { g_slist_free_full(prefixes, g_free); prefixes = NULL; @@ -260,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); @@ -275,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)) @@ -308,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, @@ -333,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. |