Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. provision an already connected service (Christophe Ronco)
----------------------------------------------------------------------
Message: 1
Date: Wed, 17 Jul 2019 11:25:27 +0200
From: Christophe Ronco <[email protected]>
To: "[email protected]" <[email protected]>
Subject: provision an already connected service
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
Hi,
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.
Event:
I create /etc/network/connman/kconf.config (/etc/network/connman is my
storage dir in my setup) with these data:
[service_lan]
Type = ethernet
IPv4 = 192.168.4.181/192.168.4.4/255.255.254.0
Nameservers = 8.8.8.8
These values are taken into account for Ethernet service:
root@klk-wiis-020006:~ # connmanctl
connmanctl> services ethernet_7076ff030010_cable
/net/connman/service/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=192.168.4.181, Netmask=255.255.254.0,
Gateway=192.168.4.4 ]
? IPv4.Configuration = [ Method=fixed, Address=192.168.4.181,
Netmask=255.255.254.0, Gateway=192.168.4.4 ]
? IPv6 = [ Method=auto, Address=fdf4:ffb1:9715:b409:7276:ffff:fe03:10,
PrefixLength=64, Privacy=disabled ]
? IPv6.Configuration = [ Method=auto, Privacy=disabled ]
? Nameservers = [ 8.8.8.8 ]
? Nameservers.Configuration = [? ]
? Timeservers = [? ]
? Timeservers.Configuration = [? ]
? Domains = [ klksi.fr ]
? Domains.Configuration = [? ]
? Proxy = [ Method=direct ]
? Proxy.Configuration = [? ]
? mDNS = False
? mDNS.Configuration = False
? Provider = [? ]
But current configuration is not modified (still got DHCP address):
root@klk-wiis-020006:~ # ifconfig eth0
eth0????? Link encap:Ethernet? HWaddr 70:76:FF:03:00:10
????????? inet addr:192.168.4.110? Bcast:192.168.5.255? Mask:255.255.254.0
????????? inet6 addr: fdf4:ffb1:9715:b409:7276:ffff:fe03:10/64 Scope:Global
????????? inet6 addr: fe80::7276:ffff:fe03:10/64 Scope:Link
????????? UP BROADCAST RUNNING MULTICAST? MTU:1500? Metric:1
????????? 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:
<http://lists.01.org/pipermail/connman/attachments/20190717/2c3bba98/attachment.log>
-------------- 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:
<http://lists.01.org/pipermail/connman/attachments/20190717/2c3bba98/attachment.patch>
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 45, Issue 9
**************************************