Hi,

I looked into this a little more.

On Wed, May 11, 2011 at 10:14:38AM -0400, Forest Bond wrote:
> Hi,
> 
> On Wed, May 11, 2011 at 01:04:16AM +0200, Thierry Boureille wrote:
> > I'm currently doing some tests after moving from connman-0.64 to
> > last release. Maybe I"m wrong but it seems that now ip v4 address is
> > not correctly released when changing configuration from dhcp to
> > manual. That leads to have multiple IP on interface (is it quite
> > similar to
> > http://lists.connman.net/pipermail/connman/2011-April/004699.html ?)
> 
> I am trying to track down what I belive is the same issue.

[...]

> So setting the IPv4.Configuration property causes an additional DHCP lease to 
> be
> acquired each time.  I don't think we should be doing anything if the property
> is set without actually changing the value.  Certainly if we do anything at 
> all
> it should be to renew the current lease.

The issue here is in set_ipconfig (service.c):

        old_method = __connman_ipconfig_get_method(ipconfig);

        if (is_connecting_state(service, state) ||
                                        is_connected_state(service, state))
                __connman_network_clear_ipconfig(service->network, ipconfig);

        err = __connman_ipconfig_set_config(ipconfig, array);
        method = __connman_ipconfig_get_method(ipconfig);
        type = __connman_ipconfig_get_config_type(ipconfig);

So if the service is connected when the property is set, it is immediately
disconnected regardless of whether the configuration is actually going to
change.  This seems tricky to fix because of how things are layered—we don't
know what the new method is until after we've changed the ipconfig, but if the
configuration is changing we must clear the old config and do some
network-related cleanup before we can apply the new one.

> The additional issue is that it seems that we are trying to release the old
> lease and then acquire a new one but the release isn't actually working.  From
> the logs (with CONNMAN_DHCP_DEBUG=1) I see that a DHCP release request is 
> being
> sent ("DHCP: sending DHCP release request"), and I do see "eth0 ip release"
> debug messages, too, so I'm not sure what is going wrong.

This issue happens because we do the DHCP release and then immediately free the
DHCP client without waiting for the callback, so the address is never removed
from the interface.  Thierry, your patch addresses this by always removing the
address, which makes some sense because we know that we are not going to remove
it otherwise (since we free the DHCP client).  But I am also unsure about it
being the best fix.  It does seem to be a reasonable work-around.

Thanks,
Forest
-- 
Forest Bond
rapidrollout.com / alittletooquiet.net / pytagsfs.org

Attachment: signature.asc
Description: Digital signature

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to