Hi, On Thu, 2015-05-21 at 11:42 +0530, Saurav Babu wrote: > <EP-584CD5AB95AE4A3A879836122994DB42> > > > So, in which cases does this issue manifest itself? From the code we can > > read what it does, but what is causing an IP address to change to > > something else? What's the use case and environment for this to happen? > > Here MAC Address is changing. Below is scenario: > 1. Ethernet is up with some MAC Address and connman creates ipdevice > with that address > 2. After some time if MAC Address is changed then MAC Address is not > updated in connman > 3. When "Ethernet" property of service is obtained then it returns > initial MAC address, not the updated one. > > I'm not sure if it is a valid case where device's MAC Address is > changed but in Ubuntu you can cross check by updating MAC address for > ethernet using "ifconfig" and then getting service property using > connmanctl. > > In my case there is a device where MAC Address is set by some other > process which sometimes starts after connman is started. Initially > MAC Address for ethernet is set as FF:FF:FF:FF:FF:FF by kernel. But > after MAC Address is updated by other process it is not reflected in > connman's service.
If the MAC address changes, the current service needs to be disconnected, as another one may have a different IP address configuration method defined based on the MAC address. Either that other service exists saved to disk or matched from another pre-provisioned .config file. So once the MAC address changes, one needs to disconnect the existing service and have ConnMan apply the correct settings according to that new MAC address. > >> --- > >> src/ipconfig.c | 4 ++++ > >> 1 file changed, 4 insertions(+) > >> > >> diff --git a/src/ipconfig.c b/src/ipconfig.c > >> index f8c148b..eb18533 100644 > >> --- a/src/ipconfig.c > >> +++ b/src/ipconfig.c > >> @@ -508,6 +508,10 @@ void __connman_ipconfig_newlink(int index, unsigned > >> short type, > >> index, type, type2str(type)); > >> > >> update: > >> + if (g_strcmp0(ipdevice->address, address) != 0) { > >> + g_free(ipdevice->address); > >> + ipdevice->address = g_strdup(address); > >> + } > >> ipdevice->mtu = mtu; > >> > >> update_stats(ipdevice, ifname, stats); > > > Should something happen if DHCP is in use and a a different address gets > > set...? > > Here MAC Address of device is getting changed. I didn't observed any issue > with DHCP or > manual configuration. My bad, I thought ipdevice->address was pointing at an IP address... Cheers, Patrik _______________________________________________ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman