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. [PATCH] config: Add support matching on device name for
provisioning (Daniel Wagner)
2. Re: Why can't connman automatically enable and connect to
cellular network interface? (Daniel Wagner)
3. Re: Why can't connman automatically enable and connect to
cellular network interface? (Daniel Wagner)
4. Re: VLAN configuration support (Daniel Wagner)
5. Re: Why can't connman automatically enable and connect to
cellular network interface? (JH)
6. Re: Why can't connman automatically enable and connect to
cellular network interface? (Daniel Wagner)
----------------------------------------------------------------------
Message: 1
Date: Mon, 29 Apr 2019 21:22:00 +0200
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [PATCH] config: Add support matching on device name for
provisioning
Message-ID: <[email protected]>
While matching on the MAC address is working for plain interfaces, it
wont work for managing VLAN interfaces. The VLAN interfaces share the
same MAC address with the parent interface.
The argument that the MAC address is the only stable way to identify a
device is a bit weak because the MAC can be changed via udev or other
means.
Furthermore, with systemd's feature of stable interface name it makes
things a lot easier for embedded system with a pre-provisioning
rootfs. Such devices have different MAC address but all of them have
the same interface name.
---
doc/config-format.txt | 2 ++
doc/connman-service.config.5.in | 9 +++++++++
src/config.c | 27 +++++++++++++++++++++++++++
3 files changed, 38 insertions(+)
diff --git a/doc/config-format.txt b/doc/config-format.txt
index 584220f0bf0e..cdde9cbcf676 100644
--- a/doc/config-format.txt
+++ b/doc/config-format.txt
@@ -59,6 +59,8 @@ an identifier unique to the config file.
interface is used. The byte values must have prefix 0 added,
the bytes must be separated by ":" char and its length must be
exactly 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 = 17 characters.
+- DeviceName: The interface name where this setting should be applied, e.g.
+ eth0. The MAC address will take preference over DeviceName in matching.
- Nameservers: Comma separated list of nameservers
- SearchDomains: Comma separated list of DNS search domains
- Timeservers: Comma separated list of timeservers
diff --git a/doc/connman-service.config.5.in b/doc/connman-service.config.5.in
index eb63f225b515..701f61f9ea13 100644
--- a/doc/connman-service.config.5.in
+++ b/doc/connman-service.config.5.in
@@ -59,6 +59,10 @@ IPv6 privacy settings as per RFC3041.
MAC address of the interface to be used. If not specified, the first
found interface is used. Must be in format ab:cd:ef:01:23:45.
.TP
+.BI DeviceName= ifname
+Device name the interface to be used, e.g. eth0. MAC takes preference
+over DeviceName.
+.TP
.BI Nameservers= servers
Comma separated list of nameservers.
.TP
@@ -209,6 +213,11 @@ Name = my_home_wifi
Passphrase = password
IPv4 = 192.168.2.2/255.255.255.0/192.168.2.1
MAC = 06:05:04:03:02:01
+
+[service_vlan]
+Type = ethernet
+DeviceName = enp4s0.1
+IPv4 = 192.168.1.42/255.255.255.0/192.168.1.1
.fi
.SH "SEE ALSO"
.BR connman (8)
diff --git a/src/config.c b/src/config.c
index af4f07e1e578..62023b1072da 100644
--- a/src/config.c
+++ b/src/config.c
@@ -72,6 +72,7 @@ struct connman_config_service {
char *ipv6_gateway;
char *ipv6_privacy;
char *mac;
+ char *devname;
bool mdns;
char **nameservers;
char **search_domains;
@@ -119,6 +120,7 @@ static bool cleanup = false;
#define SERVICE_KEY_IPv6 "IPv6"
#define SERVICE_KEY_IPv6_PRIVACY "IPv6.Privacy"
#define SERVICE_KEY_MAC "MAC"
+#define SERVICE_KEY_DEVICE_NAME "DeviceName"
#define SERVICE_KEY_NAMESERVERS "Nameservers"
#define SERVICE_KEY_SEARCH_DOMAINS "SearchDomains"
#define SERVICE_KEY_TIMESERVERS "Timeservers"
@@ -154,6 +156,7 @@ static const char *service_possible_keys[] = {
SERVICE_KEY_IPv6,
SERVICE_KEY_IPv6_PRIVACY,
SERVICE_KEY_MAC,
+ SERVICE_KEY_DEVICE_NAME,
SERVICE_KEY_MDNS,
SERVICE_KEY_NAMESERVERS,
SERVICE_KEY_SEARCH_DOMAINS,
@@ -257,6 +260,7 @@ static void unregister_service(gpointer data)
g_free(config_service->ipv6_gateway);
g_free(config_service->ipv6_privacy);
g_free(config_service->mac);
+ g_free(config_service->devname);
g_strfreev(config_service->nameservers);
g_strfreev(config_service->search_domains);
g_strfreev(config_service->timeservers);
@@ -478,6 +482,12 @@ static bool load_service_generic(GKeyFile *keyfile,
service->mac = str;
}
+ str = __connman_config_get_string(keyfile, group,
SERVICE_KEY_DEVICE_NAME, NULL);
+ if (str) {
+ g_free(service->devname);
+ service->devname = str;
+ }
+
str = __connman_config_get_string(keyfile, group, SERVICE_KEY_DOMAIN,
NULL);
if (str) {
g_free(service->domain_name);
@@ -531,6 +541,7 @@ static bool load_service_generic(GKeyFile *keyfile,
g_free(service->ipv6_address);
g_free(service->ipv6_gateway);
g_free(service->mac);
+ g_free(service->devname);
g_free(service);
return false;
@@ -1271,6 +1282,22 @@ static int try_provision_service(struct
connman_config_service *config,
if (g_ascii_strcasecmp(device_addr, config->mac) != 0)
return -ENOENT;
+ } else if (config->devname) {
+ struct connman_device *device;
+ const char *devname;
+
+ device = connman_network_get_device(network);
+ if (!device) {
+ connman_error("Network device is missing");
+ return -ENODEV;
+ }
+
+ devname = connman_device_get_string(device, "Interface");
+
+ DBG("wants %s has %s", config->devname, devname);
+
+ if (g_ascii_strcasecmp(devname, config->devname) != 0)
+ return -ENOENT;
}
if (!config->ipv6_address) {
--
2.20.1
------------------------------
Message: 2
Date: Mon, 29 Apr 2019 21:24:40 +0200
From: Daniel Wagner <[email protected]>
To: JH <[email protected]>
Cc: [email protected]
Subject: Re: Why can't connman automatically enable and connect to
cellular network interface?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
On 4/25/19 10:28 AM, JH wrote:
> Hi Daniel,
>
>> In the other mail you mentioned this. Though looking at the paths/file
>> names it looked wrong. The provisioning files life just under
>> /var/lib/connman and not in /var/lib/connman/$id/settings. Only files
>> under /var/lib/connman/$name.config will be monitored by ConnMan.
>
> I did try to use the $name.config, it did not work either, did I get
> wrong with the $name?
>
> $ cat /var/lib/connman/tpg-mcnf.conf
> [service_wifi]
> Name=TPG-MCNF
> SSID=5450472d4d434e44
> Passphrase=xxxxxx
> AutoConnect=true
>
> $ cat /var/lib/connman/telstra.conf
> [cellular_505013520350165_context1]
> Name=Telstra
> Favorite=true
> AutoConnect=true
>
> Tarmo: You can find format and information in doc/config-format.txt.
Did you try to add 'Type="?
------------------------------
Message: 3
Date: Mon, 29 Apr 2019 21:28:25 +0200
From: Daniel Wagner <[email protected]>
To: JH <[email protected]>, Tarmo Kuuse <[email protected]>
Cc: [email protected]
Subject: Re: Why can't connman automatically enable and connect to
cellular network interface?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
On 4/26/19 12:08 PM, JH wrote:
>> BTW: you've used ".conf" suffix but the document mandates ".config".
>
> Yeap, I sent another email to correct my typo.
You can see what ConnMan thinks of your config file by
# ./connmand -n -d src/config.c
connmand[11316]: Adding configuration test
connmand[11316]: Type of the configured service is missing for group
service_home
connmand[11316]: Config file /var/lib/connman/test.config does not
contain any configuration that can be provisioned!
connmand[11316]: Removing configuration .#test
connmand[11316]: Adding configuration .#test
connmand[11316]: Removing configuration test
connmand[11316]: Adding configuration test
connmand[11316]: Type of the configured service is missing for group
service_home
>> Regardless, connman v1.36 certainly doesn't follow the file structure
>> described in doc/config-format.txt. After manually provisioning my
>> dial-up connection I can see directories:
>>
>> /var/lib/connman/cellular_248030054743345_context1/
>> /var/lib/connman/ethernet_00e04c2154c3_cable/
>>
>> Both contain two files "data" and "settings". Here's a "settings" file,
>> which does what you're looking to do - start the dial-up on boot.
>
> That is the normal connman set up, I think what Daniel and document
> said was if you deploy a file ${name}.config to /var/lib/connman, the
> connman daemon will be notified and auto connect those services
> without manual configuration that what embedded systems require. But
> the auto connect feature does not seem work, Daniel is busy.
>
> Daniel, if you could let me know that is the issue to cause auto
> connect not working, where to look, I will try it.
I understand you have at least two problems which you try to solve. For
the provisioning the above trick might help.
Can you post the output from the list-services script?
Thanks,
Daniel
------------------------------
Message: 4
Date: Mon, 29 Apr 2019 21:30:22 +0200
From: Daniel Wagner <[email protected]>
To: "Langlois, Maxime" <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: Re: VLAN configuration support
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
Hi Maxime,
>> If it ever occurs that I retain the connman solution, I certainly might
>> submit the patches.
Just posted a patch which adds support to match on device name. Please
if possible give them a spin and report back.
Thanks,
Daniel
------------------------------
Message: 5
Date: Tue, 30 Apr 2019 08:35:20 +1000
From: JH <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: Tarmo Kuuse <[email protected]>, [email protected]
Subject: Re: Why can't connman automatically enable and connect to
cellular network interface?
Message-ID:
<CAA=hcwsayqea2w7gsgx0hsppfdvicq-rvr0vmgkzewj5f+x...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Hi Daniel,
On 4/30/19, Daniel Wagner <[email protected]> wrote:
> On 4/26/19 12:08 PM, JH wrote:
>>> BTW: you've used ".conf" suffix but the document mandates ".config".
>>
>> Yeap, I sent another email to correct my typo.
>
> You can see what ConnMan thinks of your config file by
>
> # ./connmand -n -d src/config.c
Thanks for the debug tip, here was the result:
# connmand -n -d src/config.c
connmand[316]: Connection Manager version 1.35
connmand[316]: Adding configuration wifi
connmand[316]: Unknown configuration key AutoConnect in [service_wifi]
connmand[316]: Config file /var/lib/connman/wifi.config does not
contain any configuration that can be provisioned!
connmand[316]: Adding configuration cellular
connmand[316]: Config file /var/lib/connman/cellular.config does not
contain any configuration that can be provisioned!
connmand[316]: Adding configuration telstra
connmand[316]: Config file /var/lib/connman/telstra.config does not
contain any configuration that can be provisioned!
connmand[316]: Adding configuration tpg-mcnf
connmand[316]: Unknown configuration key AutoConnect in [service_wifi]
connmand[316]: Config file /var/lib/connman/tpg-mcnf.config does not
contain any configuration that can be provisioned!
connmand[316]: Checking loopback interface settings
connmand[316]: System hostname is solarevk
connmand[316]: lo {newlink} index 1 address 00:00:00:00:00:00 mtu 65536
connmand[316]: lo {newlink} index 1 operstate 0 <UNKNOWN>
connmand[316]: eth0 {create} index 2 type 1 <ETHER>
connmand[316]: eth0 {RX} 1366 packets 1565375 bytes
connmand[316]: eth0 {TX} 537 packets 56096 bytes
connmand[316]: eth0 {update} flags 36866 <DOWN>
connmand[316]: eth0 {newlink} index 2 address 00:04:9F:05:0F:C0 mtu 1500
connmand[316]: eth0 {newlink} index 2 operstate [ 526.743775] Micrel
KSZ8081 or KSZ8091 20b4000.ethernet-1:01: attached PHY driver [Micrel
KSZ8081 or KSZ8091] (mii_bus:phy_addr=20b4000.ethernet-1:01, irq=POLL)
2 <DOWN>
connmand[316]: Adding interface eth0 [ ethernet ]
connmand[316]: eth1 {create} index 3 type 1 <ETHER>
connmand[316]: eth1 {update} flags 36866 <DOWN>
connmand[316]: eth1 {newlink} index 3 address 00:04:9F:05:0F:BF mtu 1500
connmand[316]: eth1 {newlink} index 3 operstate 2 <DOWN>
[ 526.839872] Micrel KSZ8081 or KSZ8091 20b4000.ethernet-1:02:
attached PHY driver [Micrel KSZ8081 or KSZ8091]
(mii_bus:phy_addr=20b4000.ethernet-1:02, irq=POLL)
connmand[316]: Adding interface eth1 [ ethernet ]
connmand[316]: sit0 {newlink} index 4 address 00:00:00:00:08:00 mtu 1480
connmand[316]: sit0 {newlink} index 4 operstate 2 <DOWN>
connmand[316]: can0 {newlink} index 5 address 00:00:00:00:00:00 mtu 16
connmand[316]: can0 {newlink} index 5 operstate 2 <DOWN>
connmand[316]: eth0 {RX} 1366 packets 1565375 bytes
connmand[316]: eth0 {TX} 537 packets 56096 bytes
connmand[316]: eth0 {update} flags 36867 <UP>
connmand[316]: eth0 {newlink} index 2 address 00:04:9F:05:0F:C0 mtu 1500
connmand[316]: eth0 {newlink} index 2 operstate 2 <DOWN>
connmand[316]: can1 {newlink} index 6 address 00:00:00:00:00:00 mtu 16
connmand[316]: can1 {newlink} index 6 operstate 2 <DOWN>
connmand[316]: mlan0 {create} index 7 type 1 <ETHER>
connmand[316]: mlan0 {update} flags 4098 <DOWN>
connmand[316]: mlan0 {newlink} index 7 address D4:CA:6E:00:1B:C0 mtu 1500
connmand[316]: mlan0 {newlink} index 7 operstate 2 <DOWN>
connmand[316]: Adding interface mlan0 [ wifi ]
connmand[316]: eth1 {update} flags 36867 <UP>
connmand[316]: eth1 {newlink} index 3 address 00:04:9F:05:0F:BF mtu 1500
connmand[316]: eth1 {newlink} index 3 operstate 2 <DOWN>
[ 528.866542] fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full -
flow control rx/tx
[ 528.875057] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
connmand[316]: eth0 {add} route ff00:: gw :: scope 0 <UNIVERSE>
connmand[316]: eth0 {add} route fe80:: gw :: scope 0 <UNIVERSE>
connmand[316]: eth0 {RX} 1366 packets 1565375 bytes
connmand[316]: eth0 {TX} 537 packets 56096 bytes
connmand[316]: eth0 {update} flags 102467 <UP,RUNNING,LOWER_UP>
connmand[316]: eth0 {newlink} index 2 address 00:04:9F:05:0F:C0 mtu 1500
connmand[316]: eth0 {newlink} index 2 operstate 6 <UP>
connmand[316]: Skipping disconnect of carrier, network is connecting.
connmand[316]: eth0 {add} address 192.168.1.13/24 label eth0 family 2
connmand[316]: eth0 {add} route 192.168.1.0 gw 0.0.0.0 scope 253 <LINK>
connmand[316]: eth0 {add} route 192.168.1.1 gw 0.0.0.0 scope 253 <LINK>
connmand[316]: eth0 {add} route 0.0.0.0 gw 192.168.1.1 scope 0 <UNIVERSE>
connmand[316]: eth0 {add} route 212.227.81.55 gw 192.168.1.1 scope 0 <UNIVERSE>
connmand[316]: eth0 {add} route fd50:4b8:60c3:600:: gw :: scope 0 <UNIVERSE>
connmand[316]: eth0 {del} route 212.227.81.55 gw 192.168.1.1 scope 0 <UNIVERSE>
connmand[316]: eth0 {add} address
fd50:4b8:60c3:600:204:9fff:fe05:fc0/64 label (null) family 10
Hmm, looks like the configure file is not proper formatted, I
referenced the configure file format from config-format.txt, would was
I missing?
# cat wifi.config
[global]
Name = wifi
Description = WiFi
[service_wifi]
Name=TPG-MCNF
SSID=5450472d4d434e46
Passphrase=XXXXX
AutoConnect=true
# cat cellular.config
[global]
Name = cellular
Description = Cellular
[service_cellular]
Name=Telstra
Favorite=true
AutoConnect=true
> I understand you have at least two problems which you try to solve. For
> the provisioning the above trick might help.
>
> Can you post the output from the list-services script?
That script was not built in image, I'll have to add the test script
to the image and post the output here soon.
Thank you Daniel.
- jupiter
------------------------------
Message: 6
Date: Tue, 30 Apr 2019 08:51:32 +0200
From: Daniel Wagner <[email protected]>
To: JH <[email protected]>
Cc: Tarmo Kuuse <[email protected]>, [email protected]
Subject: Re: Why can't connman automatically enable and connect to
cellular network interface?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
On 4/30/19 12:35 AM, JH wrote:
> Hmm, looks like the configure file is not proper formatted, I
> referenced the configure file format from config-format.txt, would was
> I missing?
>
> # cat wifi.config
> [global]
> Name = wifi
> Description = WiFi
>
> [service_wifi]
> Name=TPG-MCNF
> SSID=5450472d4d434e46
> Passphrase=XXXXX
> AutoConnect=true
>
> # cat cellular.config
> [global]
> Name = cellular
> Description = Cellular
>
> [service_cellular]
> Name=Telstra
> Favorite=true
> AutoConnect=true
Type is missing. See examples in config-format.txt
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 42, Issue 28
***************************************