provision an already connected service

Christophe Ronco c.ronco at
Wed Jul 17 02:25:27 PDT 2019


I have a problem when I try to provision a service that is already
connected and wasn't provisioned before.

Here is what happened:

Initial situation:
I use connman 1.36. I only have one Ethernet service.
Ethernet service is not provisioned so it defaults to DHCP, found a DHCP
server and obtained an IP address.

I create /etc/network/connman/kconf.config (/etc/network/connman is my
storage dir in my setup) with these data:
Type = ethernet
IPv4 =
Nameservers =

These values are taken into account for Ethernet service:
root at klk-wiis-020006:~ # connmanctl
connmanctl> services ethernet_7076ff030010_cable
  Type = ethernet
  Security = [  ]
  State = online
  Favorite = True
  Immutable = True
  AutoConnect = True
  Name = Wired
  Ethernet = [ Method=auto, Interface=eth0, Address=70:76:FF:03:00:10,
MTU=1500 ]
  IPv4 = [ Method=fixed, Address=, Netmask=,
Gateway= ]
  IPv4.Configuration = [ Method=fixed, Address=,
Netmask=, Gateway= ]
  IPv6 = [ Method=auto, Address=fdf4:ffb1:9715:b409:7276:ffff:fe03:10,
PrefixLength=64, Privacy=disabled ]
  IPv6.Configuration = [ Method=auto, Privacy=disabled ]
  Nameservers = [ ]
  Nameservers.Configuration = [  ]
  Timeservers = [  ]
  Timeservers.Configuration = [  ]
  Domains = [ ]
  Domains.Configuration = [  ]
  Proxy = [ Method=direct ]
  Proxy.Configuration = [  ]
  mDNS = False
  mDNS.Configuration = False
  Provider = [  ]

But current configuration is not modified (still got DHCP address):
root at klk-wiis-020006:~ # ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 70:76:FF:03:00:10
          inet addr:  Bcast:  Mask:
          inet6 addr: fdf4:ffb1:9715:b409:7276:ffff:fe03:10/64 Scope:Global
          inet6 addr: fe80::7276:ffff:fe03:10/64 Scope:Link
          RX packets:1510 errors:0 dropped:8 overruns:0 frame:0
          TX packets:190 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:182964 (178.6 KiB)  TX bytes:42668 (41.6 KiB)

In connman debug traces (attached) it seems that service is not
disconnected-reconnected. That's why there is a difference between
current real eth0 configuration and connman DBUS properties. This can be
fixed by a connman restart (this time, information in kconf.config file
will be used to connect ethernet device using fixed IP address).

If I do the same thing with an already provisioned service, it is
correctly disconnected and reconnected. At the end of operation, eth0
IP, gateway, ... is aligned with configuration in kconf.config file even
without a connman restart.

I made a patch (attached) to fix this problem. The idea is to force
service disconnection when connman knows that a new configuration is
available for this service. I have simply copied what is done in
unregister_service (src/config.c).

My questions are:
1) Do you think the behavior described here is a bug or should I not do
this (provision a connected service) / do this differently?
2) If it is a bug, is this the right way to fix it?

I will be without mail access until end of July. If you think this is a
bug and wants a patch quicker than that, please do the correct patch. If
you can wait and give me advice on what would be a correct patch, I can
submit this patch when I am back from holidays.

Best Regards,
Christophe Ronco

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dhcpToStaticNofile.log
Type: text/x-log
Size: 54642 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0018-service-disconnect-service-when-service-provisioning.patch
Type: text/x-patch
Size: 1734 bytes
Desc: not available
URL: <>

More information about the connman mailing list