Hi Samuel,

On 06/21/2011 07:11 PM, Samuel Ortiz wrote:
Hi Jukka,

On Mon, Jun 20, 2011 at 02:05:26PM +0300, Jukka Rissanen wrote:
---
  src/network.c |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/network.c b/src/network.c
index 4abcb09..0ae77ca 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1101,6 +1101,9 @@ static gboolean set_connected(gpointer user_data)
                __connman_connection_gateway_remove(service,
                                                CONNMAN_IPCONFIG_TYPE_ALL);

+               __connman_ipconfig_address_unset(ipconfig_ipv4);
+               __connman_ipconfig_address_unset(ipconfig_ipv6);
+
So we're already calling ipconfig_address_remove() from service.c and also
from dhcp.c. Why do we need this ?

Yes, the __connman_service_disconnect() will call the __connman_ipconfig_address_remove() but when changing the service, the __connman_service_disconnect() is not called at all. This means that the code path is different if you just disconnect a service and if you change from one service to another although the end result is the same i.e., the service is disconnected.

The new __connman_ipconfig_address_unset() differs in small detail from __connman_ipconfig_address_remove(). The _unset() does not call connman_ipaddress_clear() so that we do not remove addresses from internal structures. Clearing the ipaddress from ipconfig caused problems if done at this stage of the call flow (sorry, I do not remember the details).


Btw, the changelog would be the right place to explain why we do need those
calls.

Very true, I try to do better next time :)

Cheers,
Samuel.

Jukka
_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to