<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.

 Disconnecting the service doesn't change the Ethernet property of service.
 I had a service named ethernet_e8039a65a6fc_cable with MAC Address 
E8:03:9A:65:A6:FC
 Service's ethernet property was
 "Ethernet = [ Method=auto, Interface=eth0, Address=E8:03:9A:65:A6:FC, MTU=1500 
]"
 Now when I changed the MAC Address for ethernet using ifconfig
 "ifconfig eth0 hw ether 00:11:22:33:44:55"
 Service's ethernet property remained same
 "Ethernet = [ Method=auto, Interface=eth0, Address=E8:03:9A:65:A6:FC, MTU=1500 
]"

 Even after I disconnected the service using connmanctl then also it remained 
the same

 I even tried to disable and enable ethernet but with no success, Address in 
Ethernet
 property was never updated to the newer one.

 Am I missing any step here?

>> >> ---
>> >>  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...

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

Reply via email to