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. RE: Retry NTP servers periodically on startup (Craig McQueen)
   2. [PATCH] firewall-nftables: fix some typos in comments
      (Andr? Draszik)
   3. [PATCH 04/27] shared/arp: Add function
      get_interface_mac_address() (Christian Spielberger)


----------------------------------------------------------------------

Message: 1
Date: Wed, 11 Apr 2018 01:59:39 +0000
From: Craig McQueen <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: RE: Retry NTP servers periodically on startup
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Daniel Wagner wrote:
> On 04/04/2018 09:56 AM, Craig McQueen wrote:
> >> Could you post the debug log of both tests? It sounds like that in
> >> the first case, ConnMan falls back to the aggressive retry loop and
> >> in the second case it doesn't happen.
> >
> > I sent the debug logs last week. Did that provide what you needed?
> 
> Sorry about that. Got lost in the inbox. I did look at it but I need some more
> debug prints enabled. There isn't much information in the log.
> Could you try to get reproduced though this time with '-d
> src/ntp.c:src/timeserver.c' added to ConnMan command line?

I found I needed to run:

    connmand -d ../git/src/ntp.c:../git/src/timeserver.c

(I'm cross-compiling connman with the Yocto build system)

I'm attaching a log file of a test done today. The device is plugged into an 
Ethernet switch. I unplugged the switch's upstream Internet connection a few 
times, corresponding roughly to these two times in the log:

Apr 11 10:37:50
Apr 11 10:56:49
Apr 11 11:01:42

The last three lines of the log are most interesting, because it tries to use 
an IPv6 address:

Apr 11 11:01:42 wt000043 daemon.debug connmand[30185]: 
../git/src/timeserver.c:sync_next() Using timeserver 2405:3c00:5200:100::1
Apr 11 11:01:42 wt000043 daemon.debug connmand[30185]: 
../git/src/ntp.c:start_ntp() server 2405:3c00:5200:100::1 family 10
Apr 11 11:01:42 wt000043 daemon.err connmand[30185]: Failed to open time server 
socket

I wonder if the problem was related to it trying to use a server with an IPv6 
address, even though the device's kernel has no IPv6 capability.

After this, no further ntp/timeserver activity has occurred (for 54 minutes, at 
the time I'm writing this).

> > I'm interested to fix this issue soon. Has any work been done on this, or
> could I look into it?
> 
> So far I haven't done anything. If you want to dig into the problem, I suggest
> to look at the debug output of ntp.c and timeserver.c and figure out why the
> state machine is not going back the initial state looking for a NTP server. 
> From
> your description it seems we miss the some event and don't reset the state
> machine.

I can consider looking into it. First, I would be very interested to hear your 
thoughts on the IPv6 address in the above log.

By the way, what might cause ConnMan to use a 16 second polling interval, 
rather than the normal 1024 s (17 min) polling interval?

Thanks and regards,
Craig McQueen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2018-04-11_connmand_debug.zip
Type: application/x-zip-compressed
Size: 11580 bytes
Desc: 2018-04-11_connmand_debug.zip
URL: 
<http://lists.01.org/pipermail/connman/attachments/20180411/45d5c9a1/attachment-0001.bin>

------------------------------

Message: 2
Date: Wed, 11 Apr 2018 13:04:55 +0100
From: Andr? Draszik <[email protected]>
To: [email protected]
Subject: [PATCH] firewall-nftables: fix some typos in comments
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

From: Andr? Draszik <[email protected]>

---
 src/firewall-nftables.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/firewall-nftables.c b/src/firewall-nftables.c
index 1febce44..8ef3ba1e 100644
--- a/src/firewall-nftables.c
+++ b/src/firewall-nftables.c
@@ -670,7 +670,7 @@ static int build_rule_snat(int index, const char *address,
        nftnl_rule_set(rule, NFTNL_RULE_TABLE, CONNMAN_TABLE);
        nftnl_rule_set(rule, NFTNL_RULE_CHAIN, CONNMAN_CHAIN_NAT_POST);
 
-       /* IOF */
+       /* OIF */
        expr = nftnl_expr_alloc("meta");
        if (!expr)
                goto err;
@@ -1003,7 +1003,7 @@ static int create_table_and_chains(struct nftables_info 
*nft_info)
 
        /*
         * # nft add chain connman nat-prerouting               \
-        *      { type nat hook prerouting priortiy 0 ; }
+        *      { type nat hook prerouting priority 0 ; }
         */
        chain = build_chain(CONNMAN_CHAIN_NAT_PRE, CONNMAN_TABLE,
                                "nat", NF_INET_PRE_ROUTING, 0);
@@ -1020,7 +1020,7 @@ static int create_table_and_chains(struct nftables_info 
*nft_info)
 
        /*
         * # nft add chain connman nat-postrouting              \
-        *      { type nat hook postrouting priortiy 0 ; }
+        *      { type nat hook postrouting priority 0 ; }
         */
        chain = build_chain(CONNMAN_CHAIN_NAT_POST, CONNMAN_TABLE,
                                "nat", NF_INET_POST_ROUTING, 0);
-- 
2.16.2



------------------------------

Message: 3
Date: Wed, 11 Apr 2018 16:00:24 +0200
From: Christian Spielberger <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: [email protected], Christian Spielberger
        <[email protected]>
Subject: [PATCH 04/27] shared/arp: Add function
        get_interface_mac_address()
Message-ID:
        <[email protected]>

Following ACD code will need this utility function. So we moved it to
src/shared/arp.c.
---
 gdhcp/client.c   | 32 --------------------------------
 src/shared/arp.c | 38 ++++++++++++++++++++++++++++++++++++++
 src/shared/arp.h |  2 ++
 3 files changed, 40 insertions(+), 32 deletions(-)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index 14c83b6..e36c4e0 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -607,38 +607,6 @@ static gboolean send_announce_packet(gpointer dhcp_data)
        return TRUE;
 }
 
-static void get_interface_mac_address(int index, uint8_t *mac_address)
-{
-       struct ifreq ifr;
-       int sk, err;
-
-       sk = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
-       if (sk < 0) {
-               perror("Open socket error");
-               return;
-       }
-
-       memset(&ifr, 0, sizeof(ifr));
-       ifr.ifr_ifindex = index;
-
-       err = ioctl(sk, SIOCGIFNAME, &ifr);
-       if (err < 0) {
-               perror("Get interface name error");
-               goto done;
-       }
-
-       err = ioctl(sk, SIOCGIFHWADDR, &ifr);
-       if (err < 0) {
-               perror("Get mac address error");
-               goto done;
-       }
-
-       memcpy(mac_address, ifr.ifr_hwaddr.sa_data, 6);
-
-done:
-       close(sk);
-}
-
 void g_dhcpv6_client_set_retransmit(GDHCPClient *dhcp_client)
 {
        if (!dhcp_client)
diff --git a/src/shared/arp.c b/src/shared/arp.c
index e6c06fd..f43cbd1 100644
--- a/src/shared/arp.c
+++ b/src/shared/arp.c
@@ -19,17 +19,22 @@
  */
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
 
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/types.h>
+#include <sys/ioctl.h>
+
 #include <netpacket/packet.h>
 #include <net/ethernet.h>
 #include <netinet/if_ether.h>
 #include <net/if_arp.h>
 
+#include <linux/if.h>
+
 #include <arpa/inet.h>
 
 #include "src/shared/arp.h"
@@ -106,3 +111,36 @@ int arp_socket(int ifindex)
 
        return fd;
 }
+
+void get_interface_mac_address(int index, uint8_t *mac_address)
+{
+       struct ifreq ifr;
+       int sk, err;
+
+       sk = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
+       if (sk < 0) {
+               perror("Open socket error");
+               return;
+       }
+
+       memset(&ifr, 0, sizeof(ifr));
+       ifr.ifr_ifindex = index;
+
+       err = ioctl(sk, SIOCGIFNAME, &ifr);
+       if (err < 0) {
+               perror("Get interface name error");
+               goto done;
+       }
+
+       err = ioctl(sk, SIOCGIFHWADDR, &ifr);
+       if (err < 0) {
+               perror("Get MAC address error");
+               goto done;
+       }
+
+       memcpy(mac_address, ifr.ifr_hwaddr.sa_data, ETH_ALEN);
+
+done:
+       close(sk);
+}
+
diff --git a/src/shared/arp.h b/src/shared/arp.h
index 259e962..1191827 100644
--- a/src/shared/arp.h
+++ b/src/shared/arp.h
@@ -39,4 +39,6 @@ int send_arp_packet(uint8_t* source_eth, uint32_t source_ip,
                    uint32_t target_ip, int ifindex);
 int arp_socket(int ifindex);
 
+void get_interface_mac_address(int index, uint8_t *mac_address);
+
 #endif
-- 
2.7.4



------------------------------

Subject: Digest Footer

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


------------------------------

End of connman Digest, Vol 30, Issue 3
**************************************

Reply via email to