RE: Retry NTP servers periodically on startup
by Craig McQueen
Daniel Wagner wrote:
> On 01/17/2018 08:50 AM, Daniel Wagner wrote:
> > This is the attempt to fix the outstanding CM-636 bug. This is still
> > not completely finished. There is some more potential to cleanup the
> > timeserver code. But I thought maybe someone wants to test it. You can
> > install a iptables rule to see if the retry logic works.
> >
> > iptables -A OUTPUT -p tcp --dport 123 -j DROP
> > iptables -A OUTPUT -p udp --dport 123 -j DROP
> >
> > This should do the trick.
>
> After some more debugging and removing of the unnecessary DBG() I
> applied this.
I have a device using ConnMan 1.32, which is connected to the Internet through a FritzBox home ADSL router. It is configured with NTP servers:
0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org, 3.pool.ntp.org
It additionally gets the IPv4 address of the FritzBox router itself as a further NTP server, from DHCP.
I have found that if the router is power-cycled just before the time of the next NTP sync (which occurs at roughly 17 minute intervals), then it subsequently never does any more NTP syncs.
I saw this recent work on CM-636 in the ConnMan git repository, so I have tried upgrading the devices to use a recent git commit of ConnMan. Then I retested power-cycling the router just before a scheduled NTP sync. I did the test twice, and the first time, it still did a sync a minute later, after the router rebooted. But the second time I did the test, the device subsequently never has done any more NTP syncs. That was roughly 14 hours ago.
Any ideas on what is going on?
--
Craig McQueen
2 years, 10 months
[RFC PATCH 00/27] Implement Address Conflict Detection (ACD), RFC 5227
by Peter Meerwald-Stadler
Patch series implementing Address Conflict Detection (ACD) according to RFC 5227,
please comment/review! The patches are served in small chunks for review.
ACD is not enabled by default, but can be enabled in Connman's main.conf.
Patches 1 to 8 are unrelated and move common code to src/shared.
Patch 9 adds new files for ACD and the following patches add functionality.
The IPv4LL code was used as a basis for implementing ACD.
High-level conflict handling is placed in service, Patches 20 to 22.
Patch 23 adds a DBus property to inform about ACD
Patches 24 to 27 implement sending a DHCP decline message in case an address
conflict is detected.
Christian Spielberger (26):
.gitignore: add vim swp files; add tags file
add .ycm conf to .gitignore
acd: Add random_delay_ms() function from gdhcp
dhcp: Use shared get_random() function
shared: Add low-level ARP functions
shared/arp: Add function get_interface_mac_address()
shared/arp: Add random_ip()
inet: Add function connman_inet_is_ifup()
Add Address Conflict Detection support (RFC 5227)
acd: add struct _ACDHost
acd: add functions start/stop_listening
acd: add send_probe_packet
acd: add send_announce_packet
acd: add callback function pointers
acd: add acdhost_start and acdhost_stop
acd: add acd_defend_timeout and acd_announce_timeout
acd: add handling of received arp packets
acd: add callback registration
service: init and start of acd
service: add acd callback functions
service: add ipv4ll as fallback for acd
acd: add dbus property for address conflict
dhcp: add sending of DHCP decline
network: add function for delayed dhcp start
acd: add acdhost_get_conflicts_count
service: send DHCP decline in case of address conflict
Peter Meerwald-Stadler (1):
doc: Add documentation for AddressConflictDetection
.gitignore | 3 +
Makefile.am | 17 +-
doc/connman.conf.5.in | 10 +
gdhcp/client.c | 88 +++---
gdhcp/common.c | 39 +--
gdhcp/gdhcp.h | 4 +-
include/acd.h | 62 ++++
include/inet.h | 1 +
include/network.h | 2 +
include/service.h | 2 +
src/acd.c | 569 +++++++++++++++++++++++++++++++++++++
src/connman.h | 1 +
src/dhcp.c | 26 +-
src/inet.c | 34 +++
src/main.c | 16 ++
src/network.c | 69 +++++
src/service.c | 224 +++++++++++++++
gdhcp/ipv4ll.c => src/shared/arp.c | 103 ++++---
gdhcp/ipv4ll.h => src/shared/arp.h | 41 ++-
src/shared/random.c | 78 +++++
src/shared/random.h | 30 ++
21 files changed, 1263 insertions(+), 156 deletions(-)
create mode 100644 include/acd.h
create mode 100644 src/acd.c
rename gdhcp/ipv4ll.c => src/shared/arp.c (67%)
rename gdhcp/ipv4ll.h => src/shared/arp.h (55%)
create mode 100644 src/shared/random.c
create mode 100644 src/shared/random.h
--
2.16.2
2 years, 11 months
dhcp-server-test and dhcp-test demoes error
by 1351706412@qq.com
Dear Daniel,
i am now studying the source code of connman and learn some
test demoes about "dhcp-server-test/dhcp-test" in the directory of tools.
firstly, type "ip link" i get:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp4s0f2: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 40:16:7e:44:76:e5 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
link/ether 54:35:30:27:99:ff brd ff:ff:ff:ff:ff:ff
5: vmnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 00:50:56:c0:00:01 brd ff:ff:ff:ff:ff:ff
6: vmnet8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 00:50:56:c0:00:08 brd ff:ff:ff:ff:ff:ff
7: wlx7cdd90caf78b: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
link/ether 7c:dd:90:ca:f7:8b brd ff:ff:ff:ff:ff:ff
then,
test@ubuntu:/connman/tools$ ./dhcp-server-test 2
Create DHCP server for interface 2
DHCP: option_code 1 option_value 255.255.0.0
DHCP: option_code 3 option_value 192.168.0.2
DHCP: option_code 6 option_value 192.168.0.3
Start DHCP Server operation
and ,open another terminal,
test@ubuntu:/connman/tools$ ./dhcp-test 2
Create DHCP client for interface 2
Start DHCP operation
and, my ifconfig info are:
enp4s0f2 Link encap:Ethernet HWaddr 40:16:7e:44:76:e5
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::4216:7eff:fe44:76e5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:296 errors:0 dropped:0 overruns:0 frame:0
TX packets:806 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:106874 (106.8 KB) TX bytes:127989 (127.9 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:260701 errors:0 dropped:0 overruns:0 frame:0
TX packets:260701 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:24663612 (24.6 MB) TX bytes:24663612 (24.6 MB)
vmnet1 Link encap:Ethernet HWaddr 00:50:56:c0:00:01
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:130 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
vmnet8 Link encap:Ethernet HWaddr 00:50:56:c0:00:08
inet addr:172.16.194.1 Bcast:172.16.194.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:129 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlp3s0 Link encap:Ethernet HWaddr 54:35:30:27:99:ff
UP BROADCAST MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlx7cdd90caf78b Link encap:Ethernet HWaddr 7c:dd:90:ca:f7:8b
UP BROADCAST MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
i think if the demoes is right, my ip address of enp4s0f2 will be changed,
so what wrong about that? is that connmand MUST be run?
and i interrupt the process of dhcp-server-test, and get the
error "(process:8715): GLib-CRITICAL **: Source ID 4294967295 was not found when attempting to remove it
"? how to avoid this problem?
thanks a lot for any help.
1351706412(a)qq.com
2 years, 11 months
[PATCH] iwd: Create wpa_s identifiers
by Daniel Wagner
The identifier has no special meaning except it needs to be unique. It
will also be used to save and load configs. We should use the same
identifier as we have created with wpa_supplicant. This is important
when the user switches from a wpa_supplicant setup to iwd one. This
avoids reconfigurering the system.
---
plugins/iwd.c | 45 ++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 42 insertions(+), 3 deletions(-)
diff --git a/plugins/iwd.c b/plugins/iwd.c
index b5191654d6cf..6a017b2e90d0 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -484,17 +484,53 @@ static void update_signal_strength(struct iwd_device *iwdd)
DBG("GetOrderedNetworks() failed");
}
+static const char *security_remap(const char *security)
+{
+ if (!g_strcmp0(security, "open"))
+ return "none";
+ else if (!g_strcmp0(security, "psk"))
+ return "psk";
+ else if (!g_strcmp0(security, "8021x"))
+ return "ieee8021x";
+
+ return "unknown";
+}
+
+static char *create_identifier(const char *path, const char *security)
+{
+ char *start, *end, *identifier;
+ char *_path = g_strdup(path);
+
+ /*
+ * _path is something like
+ * /0/4/5363686970686f6c5f427573696e6573735f454150_8021x
+ */
+ start = strrchr(_path, '/');
+ start++;
+ end = strchr(start, '_');
+ *end = '\0';
+
+ /*
+ * Create an ident which is identical to the corresponding
+ * wpa_supplicant identifier.
+ */
+ identifier = g_strdup_printf("%s_managed_%s", start,
+ security_remap(security));
+ g_free(_path);
+
+ return identifier;
+}
+
static void add_network(const char *path, struct iwd_network *iwdn)
{
struct iwd_device *iwdd;
- const char *identifier;
+ char *identifier;
iwdd = g_hash_table_lookup(devices, iwdn->device);
if (!iwdd)
return;
- identifier = strrchr(path, '/');
- identifier++; /* strip leading slash as well */
+ identifier = create_identifier(path, iwdn->type);
iwdn->network = connman_network_create(identifier,
CONNMAN_NETWORK_TYPE_WIFI);
connman_network_set_data(iwdn->network, iwdn);
@@ -504,6 +540,7 @@ static void add_network(const char *path, struct iwd_network *iwdn)
strlen(iwdn->name));
connman_network_set_string(iwdn->network, "WiFi.Security",
iwdn->type);
+ connman_network_set_string(iwdn->network, "WiFi.Mode", "managed");
if (connman_device_add_network(iwdd->device, iwdn->network) < 0) {
connman_network_unref(iwdn->network);
@@ -514,6 +551,8 @@ static void add_network(const char *path, struct iwd_network *iwdn)
connman_network_set_available(iwdn->network, true);
connman_network_set_group(iwdn->network, identifier);
+
+ g_free(identifier);
}
static void remove_network(struct iwd_network *iwdn)
--
2.14.3
2 years, 11 months
[PATCH] config: fix incorrect timeservers assignment
by Alexander Kochetkov
The command 'connmanctl config <service> --timeservers'
(with empty --timeservers argument) will clear timeservers
array. Timeservers obtained from dhcp will be dropped from
timeservers array after the command.
That looks like copy/paste error. Instead of clearing
timeservers_config array the code clears timeservers
array.
Signed-off-by: Alexander Kochetkov <al.kochet(a)gmail.com>
---
src/service.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/service.c b/src/service.c
index ab5b2c6..529be38 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3564,8 +3564,7 @@ static DBusMessage *set_property(DBusConnection *conn,
char **timeservers = g_strsplit_set(str->str, " ", 0);
timeservers = remove_empty_strings(timeservers);
service->timeservers_config = timeservers;
- } else
- service->timeservers = NULL;
+ }
g_string_free(str, TRUE);
--
1.7.9.5
2 years, 11 months
Planning Address Conflict Detection RFC-5227
by Christian Spielberger
Hello,
We are planning to add Address Conflict Detection RFC-5227 into connman. It will
be my task to implement the main aspects of this RFC in the next 2-3 weeks.
Now I will start by cloning the project to github. Then looking where and how
to place the ACD code. If you have any hints, please let me know!
The goal would be definitely to bring it upstream.
regards,
Christian Spielberger
https://github.com/cspiel1
www.commend.com
2 years, 11 months
How does connman detect loss of connectivity for ethernet, when there is no delete link event?
by Andreas Koller
When I pull the network cable from the device, connman detects correctly,
that connectivity is lost and gives default route to wifi.
But when I pull the cable behind the router, there is no delete link detection and
and ethernet is still shown as online.
Is the online check meant to be repeated automatically?
Or is this optional behaviour, that can be enabled?
Or does it depend on specific events (eg new nameservers, delete link detection)?
2 years, 11 months
Is there a way to store static IP configuration without editing config files?
by Andreas Koller
Hi,
when using
/usr/local/lib/connman/test/set-ipv4-method ethernet_MAC_cable manual <ip> <netmask> <gateway>,
the IP for eth0 is changed to the given value, but after rebooting, it's using DHCP again.
Is there an alternate method to manually modify the config file
/var/lib/connman/ethernet_MAC_cable/settings,
for example a command for storing the current configuration?
--
2 years, 11 months
Re: what is File /proc/net/pnp doesn't exist means?
by Daniel Wagner
Hi,
On 03/21/2018 09:22 AM, 1351706412(a)qq.com wrote:
> thanks for your reply and i want to ask a question about the error
> "get_nfs_server_ip:File /proc/net/pnp doesn't exist?"
ConnMan tries to figure out if the system is booting with a NFS root
filesystem. In this case the interface on which the NFS root is wont be
touched.
> what pnp files matters? is that hot plug boot? how to user it?
> how is pnp function relate to nfs? i am so confused?
Yeah, it's annoying message we should get rid of. It's supposed to be
silent if the file doesn't exists. Care to send a patch?
Daniel
2 years, 11 months