From fc3d4097fcdbbcc6ca870ed24fec47bfb15ad90a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Tue, 3 Jan 2012 14:36:26 +0200 Subject: [PATCH] ipconfig: Have separate callbacks for route changes. Route changes should not trigger ip_bound or ip_release callbacks in service.c as that can cause too early transition into IPv6 ready state. The ip_bound (in __connman_ipconfig_newaddr()) and ip_release (in __connman_ipconfig_deladdr()) are enough to trigger a transition in IPv6 state. This also prevents too many notifier calls in session as we only notify session when address changes. --- include/ipconfig.h | 2 ++ src/ipconfig.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/ipconfig.h b/include/ipconfig.h index 34463eb..295bba8 100644 --- a/include/ipconfig.h +++ b/include/ipconfig.h @@ -81,6 +81,8 @@ struct connman_ipconfig_ops { void (*lower_down) (struct connman_ipconfig *ipconfig); void (*ip_bound) (struct connman_ipconfig *ipconfig); void (*ip_release) (struct connman_ipconfig *ipconfig); + void (*route_set) (struct connman_ipconfig *ipconfig); + void (*route_unset) (struct connman_ipconfig *ipconfig); }; struct connman_ipconfig *connman_ipconfig_create(int index, diff --git a/src/ipconfig.c b/src/ipconfig.c index 20207a1..950229d 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -941,8 +941,8 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope, if (ipconfig->ops == NULL) continue; - if (ipconfig->ops->ip_bound) - ipconfig->ops->ip_bound(ipconfig); + if (ipconfig->ops->route_set) + ipconfig->ops->route_set(ipconfig); } } @@ -1003,8 +1003,8 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope, if (ipconfig->ops == NULL) continue; - if (ipconfig->ops->ip_release) - ipconfig->ops->ip_release(ipconfig); + if (ipconfig->ops->route_unset) + ipconfig->ops->route_unset(ipconfig); } } -- 2.7.4