Send connman mailing list submissions to
        connman@lists.01.org

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
        connman-requ...@lists.01.org

You can reach the person managing the list at
        connman-ow...@lists.01.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. Re: [PATCH 21/27] acd: add dbus property for address conflict
      (Daniel Wagner)
   2. Re: [PATCH v2 00/27] implement Address Conflict Detection
      (Daniel Wagner)
   3. Re: [PATCH 08/27] doc: Add documentation for
      AddressConflictDetection (Daniel Wagner)
   4. [PATCH] inet: Remove error message if /proc/net/pnp file is
      missing (Daniel Wagner)
   5. Re: [PATCH] fixed noisy error File /proc/net/pnp doesn't
      exist (Daniel Wagner)
   6. Re: [PATCH] fixed noisy error File /proc/net/pnp doesn't
      exist (Vasyl Vavrychuk)
   7. Re: Cellular Technology with Connmanctl working only after
      board reboot (Daniel Wagner)


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

Message: 1
Date: Mon, 16 Apr 2018 17:32:59 +0200
From: Daniel Wagner <w...@monom.org>
To: Christian Spielberger <christian.spielber...@gmail.com>
Cc: connman@lists.01.org
Subject: Re: [PATCH 21/27] acd: add dbus property for address conflict
Message-ID: <0a1266f5-b817-1127-3504-65bea7124...@monom.org>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi Christian,

On 04/11/2018 04:00 PM, Christian Spielberger wrote:
> Adds a dbus property called LastAddressConflict and a signal to notify if
> the property changes.

s/dbus/D-Bus/

> --- >   doc/service-api.txt | 32 ++++++++++++++++++++
>   include/acd.h       |  5 +++-
>   include/network.h   |  4 +++
>   include/service.h   |  1 +
>   src/acd.c           | 84 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++-
>   src/network.c       | 12 +++++++-
>   src/service.c       | 11 +++++++
>   7 files changed, 146 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/service-api.txt b/doc/service-api.txt
> index b5b4fab..ac597bc 100644
> --- a/doc/service-api.txt
> +++ b/doc/service-api.txt
> @@ -513,3 +513,35 @@ Properties       string State [readonly]
>                       Same values as mDNS property. The mDNS
>                       represents the actual system configuration
>                       while this allows user configuration.
> +
> +             dict LastAddressConflict [readonly]
> +
> +                     This property contains information about the previously 
> detected
> +                     address conflict. If there has been no address conflict 
> then
> +                     IPv4 Address is "0.0.0.0", Ethernet Address is 
> "00:00:00:00:00:00",
> +                     Timestamp is zero and Resolved is true.
> +
> +                     dict IPv4 [readonly]
> +
> +                             string Address [readonly]
> +
> +                             The IPv4 address which had a conflict.
> +
> +                     dict Ethernet [readonly]
> +
> +                             string Address [readonly]
> +
> +                             The ethernet device address (MAC address) of 
> the conflicting
> +                             host.
> +
> +                     int64 Timestamp [readonly]
> +
> +                             A timestamp when the conflict was detected in 
> microseconds
> +                             since January 1, 1970 UTC.
> +
> +                     bool Resolved [readonly]
> +
> +                             Set to false when an address conflict occurs.
> +                             If a previous conflict could be resolved by 
> probing another
> +                             IPv4 address (which is not an IPv4LL) then this 
> boolean is set
> +                             to true.
> diff --git a/include/acd.h b/include/acd.h
> index dc7e570..69d740d 100644
> --- a/include/acd.h
> +++ b/include/acd.h
> @@ -25,6 +25,7 @@
>   
>   #include <stdint.h>
>   #include <glib.h>
> +#include <gdbus.h>

This include looks wrong. I don't think we export the gdbus.h header 
file and I don't see why you need.

>   
>   #ifdef __cplusplus
>   extern "C" {
> @@ -34,7 +35,7 @@ struct _acd_host;
>   
>   typedef struct _acd_host acd_host;
>   
> -acd_host *acdhost_new(int ifindex);
> +acd_host *acdhost_new(int ifindex, const char* path);
>   int acdhost_start(acd_host *acd, uint32_t ip);
>   void acdhost_stop(acd_host *acd);
>   
> @@ -52,6 +53,8 @@ void acdhost_register_event(acd_host *acd,
>                           ACDHostEventFunc func,
>                           gpointer user_data);
>   
> +void acdhost_append_dbus_property(acd_host *acd, DBusMessageIter *dict);
> +
>   #ifdef __cplusplus
>   }
>   #endif
> diff --git a/include/network.h b/include/network.h
> index 4fc20c1..22463cc 100644
> --- a/include/network.h
> +++ b/include/network.h
> @@ -24,6 +24,7 @@
>   
>   #include <stdbool.h>
>   #include <stdint.h>

empty line here

> +#include <dbus/dbus.h>
>   
>   #include <connman/device.h>
>   #include <connman/ipconfig.h>
> @@ -162,6 +163,9 @@ struct connman_network_driver {
>   int connman_network_driver_register(struct connman_network_driver *driver);
>   void connman_network_driver_unregister(struct connman_network_driver 
> *driver);
>   
> +void connman_network_append_acddbus(DBusMessageIter *dict,
> +             struct connman_network *network);
> +
>   #ifdef __cplusplus
>   }
>   #endif
> diff --git a/include/service.h b/include/service.h
> index 958e7fd..c958375 100644
> --- a/include/service.h
> +++ b/include/service.h
> @@ -117,6 +117,7 @@ enum connman_service_type connman_service_get_type(struct 
> connman_service *servi
>   char *connman_service_get_interface(struct connman_service *service);
>   
>   const char *connman_service_get_domainname(struct connman_service *service);
> +const char *connman_service_get_dbuspath(struct connman_service *service);
>   char **connman_service_get_nameservers(struct connman_service *service);
>   char **connman_service_get_timeservers_config(struct connman_service 
> *service);
>   char **connman_service_get_timeservers(struct connman_service *service);
> diff --git a/src/acd.c b/src/acd.c
> index cdd2569..f10e3d7 100644
> --- a/src/acd.c
> +++ b/src/acd.c
> @@ -21,6 +21,7 @@
>   #include <connman/log.h>
>   #include <connman/inet.h>
>   #include <glib.h>
> +#include <connman/dbus.h>

group the header file with the other connman includes.

>   #include "src/shared/arp.h"
>   #include "src/shared/random.h"
>   #include <errno.h>
> @@ -52,6 +53,13 @@ struct _acd_host {
>       uint8_t mac_address[6];
>       uint32_t requested_ip; /* host byte order */
>   
> +     /* address conflict fields */
> +     uint32_t ac_ip; /* host byte order */
> +     uint8_t ac_mac[6];
> +     gint64 ac_timestamp;
> +     bool ac_resolved;
> +     const char *path;
> +
>       bool listen_on;
>       int listener_sockfd;
>       unsigned int retry_times;
> @@ -80,6 +88,9 @@ static gboolean send_announce_packet(gpointer acd_data);
>   static gboolean acd_announce_timeout(gpointer acd_data);
>   static gboolean acd_defend_timeout(gpointer acd_data);
>   
> +/* for DBus property */

s/DBus/D-Bus/

> +static void report_conflict(acd_host *acd);
> +
>   static void debug(acd_host *acd, const char *format, ...)
>   {
>       char str[256];
> @@ -93,7 +104,7 @@ static void debug(acd_host *acd, const char *format, ...)
>       va_end(ap);
>   }
>   
> -acd_host *acdhost_new(int ifindex)
> +acd_host *acdhost_new(int ifindex, const char *path)
>   {
>       acd_host *acd;
>   
> @@ -133,6 +144,12 @@ acd_host *acdhost_new(int ifindex)
>       acd->ipv4_conflict_cb = NULL;
>       acd->ipv4_max_conflicts_cb = NULL;
>   
> +     acd->ac_ip = 0;
> +     memset(acd->ac_mac, 0, sizeof(acd->ac_mac));
> +     acd->ac_timestamp = 0;
> +     acd->ac_resolved = true;
> +     acd->path = path;
> +
>       return acd;
>   
>   error:
> @@ -346,6 +363,11 @@ static gboolean acd_defend_timeout(gpointer acd_data)
>       return FALSE;
>   }
>   
> +static bool is_link_local(uint32_t ip)
> +{
> +     return (ip & LINKLOCAL_ADDR) == LINKLOCAL_ADDR;
> +}
> +
>   static gboolean acd_announce_timeout(gpointer acd_data)
>   {
>       acd_host *acd = acd_data;
> @@ -362,6 +384,11 @@ static gboolean acd_announce_timeout(gpointer acd_data)
>       debug(acd, "switching to monitor mode");
>       acd->state = ACD_MONITOR;
>   
> +     if (!acd->ac_resolved && !is_link_local(acd->requested_ip)) {
> +             acd->ac_resolved = true;
> +             report_conflict(acd);
> +     }
> +
>       if (acd->ipv4_available_cb)
>               acd->ipv4_available_cb(acd,
>                                       acd->ipv4_available_data);
> @@ -438,6 +465,14 @@ static int acd_recv_arp_packet(acd_host *acd) {
>       }
>   
>       if (acd->conflicts < MAX_CONFLICTS) {
> +             if (!is_link_local(acd->requested_ip)) {
> +                     acd->ac_ip = acd->requested_ip;
> +                     memcpy(acd->ac_mac, arp.arp_sha, sizeof(acd->ac_mac));
> +                     acd->ac_timestamp = g_get_real_time();
> +                     acd->ac_resolved = false;
> +                     report_conflict(acd);
> +             }
> +
>               acdhost_stop(acd);
>   
>               /* we need a new request_ip */
> @@ -483,3 +518,50 @@ void acdhost_register_event(acd_host *acd,
>       }
>   }
>   
> +static void append_ac_mac(DBusMessageIter *iter, void *user_data)
> +{
> +     acd_host *acd = user_data;
> +     char mac[32];
> +     uint8_t *m = acd->ac_mac;
> +     const char *str = mac;

empty line here between decleration and implementation.

> +     snprintf(mac, sizeof(mac), "%02x:%02x:%02x:%02x:%02x:%02x",
> +                     m[0], m[1], m[2], m[3], m[4], m[5]);
> +     connman_dbus_dict_append_basic(iter, "Address", DBUS_TYPE_STRING, &str);
> +}
> +

Thanks,
Daniel


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

Message: 2
Date: Mon, 16 Apr 2018 17:40:30 +0200
From: Daniel Wagner <w...@monom.org>
To: Christian Spielberger <christian.spielber...@gmail.com>
Cc: connman@lists.01.org
Subject: Re: [PATCH v2 00/27] implement Address Conflict Detection
Message-ID: <c9ce4b77-07b7-6590-5f70-fce39cb8a...@monom.org>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi Christian,

On 04/11/2018 04:00 PM, Christian Spielberger wrote:
> This patch series implements Address Conflict Detection (ACD) according to
> RFC-5227. The review comments of the RFC PATCH series (thanks Daniel!) have
> been taken into account:
> - building with make distcheck each patch
> - move code from service.c to network.c
> - added documentation for the DBus API (patch 21)
> - other cleanup

I am sorry that I didn't take enough time last time to give proper 
feedback on all the style issues. Apart of my nitpicking on the style 
stuff the series is in a really good state, especially the commit 
message text help a lot. I think the next version is ready to be 
applied. If there are still issues we fix them up in the tree.

Thanks,
Daniel


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

Message: 3
Date: Mon, 16 Apr 2018 18:05:22 +0200
From: Daniel Wagner <w...@monom.org>
To: Christian Spielberger <christian.spielber...@gmail.com>
Cc: connman@lists.01.org
Subject: Re: [PATCH 08/27] doc: Add documentation for
        AddressConflictDetection
Message-ID: <24fa63d8-4e4c-4b55-3722-66430c6a6...@monom.org>
Content-Type: text/plain; charset=utf-8; format=flowed

>> +Default value is false.
> 
> Shouldn't we enable it on default? This feature sounds useful for everybody.

I think I can answer it myself. It adds around 10 seconds to assigns an 
IP address via DHCP.


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

Message: 4
Date: Mon, 16 Apr 2018 18:05:59 +0200
From: Daniel Wagner <w...@monom.org>
To: connman@lists.01.org
Cc: Daniel Wagner <w...@monom.org>
Subject: [PATCH] inet: Remove error message if /proc/net/pnp file is
        missing
Message-ID: <20180416160559.25758-1-w...@monom.org>

Commit 8810e72176f8 ("inet: Return error if pnp_file doesn't exists")
introduced the error message. For system without an NFS root this
is not an error. Avoid printing this message on every bootup.

Suggested-by: Vasyl Vavrychuk <vvavryc...@gmail.com>
---
 src/inet.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/inet.c b/src/inet.c
index 4c2ebb87d593..3ed83e860428 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -3068,10 +3068,8 @@ static int get_nfs_server_ip(const char *cmdline_file, 
const char *pnp_file,
                                                  pnp_file, error->message);
                        goto out;
                }
-       } else {
-               connman_error("%s: File %s doesn't exist\n", __func__, 
pnp_file);
+       } else
                goto out;
-       }
 
        len = strlen(cmdline);
        if (len <= 1) {
-- 
2.14.3


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

Message: 5
Date: Mon, 16 Apr 2018 18:07:07 +0200
From: Daniel Wagner <w...@monom.org>
To: Vasyl Vavrychuk <vvavryc...@gmail.com>, connman@lists.01.org
Subject: Re: [PATCH] fixed noisy error File /proc/net/pnp doesn't
        exist
Message-ID: <c8bdc806-1323-64b2-d81f-e3786e191...@monom.org>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi Vasyl,

On 04/16/2018 01:19 PM, Vasyl Vavrychuk wrote:
> It happend on every boot.

Yes, it is annoying indeed.

> ---
>   src/inet.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/inet.c b/src/inet.c
> index 80d96737..eb824c22 100644
> --- a/src/inet.c
> +++ b/src/inet.c
> @@ -3212,10 +3212,14 @@ out:
>   
>   bool __connman_inet_isrootnfs_device(const char *devname)
>   {
> +     const char *pnp_file = "/proc/net/pnp";
>       struct in_addr addr;
>       char ifname[IFNAMSIZ];
>   
> -     return get_nfs_server_ip(NULL, NULL, &addr) == 0 &&
> +     if (!g_file_test(pnp_file, G_FILE_TEST_EXISTS))
> +             return false;
> +
> +     return get_nfs_server_ip(NULL, pnp_file, &addr) == 0 &&

I think we should fix it at the root of the problem. See my patch I just 
sent out.

Thanks,
Daniel


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

Message: 6
Date: Mon, 16 Apr 2018 19:08:58 +0300
From: Vasyl Vavrychuk <vvavryc...@gmail.com>
To: Daniel Wagner <w...@monom.org>
Cc: connman@lists.01.org
Subject: Re: [PATCH] fixed noisy error File /proc/net/pnp doesn't
        exist
Message-ID:
        <CAGj4m+7g+r=tarp-3co303marhsr-rdnoocbsvs-nmgh6c8...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

I am fine with that.

Thanks,
Vasyl

On Mon, Apr 16, 2018 at 7:07 PM, Daniel Wagner <w...@monom.org> wrote:
> Hi Vasyl,
>
> On 04/16/2018 01:19 PM, Vasyl Vavrychuk wrote:
>>
>> It happend on every boot.
>
>
> Yes, it is annoying indeed.
>
>> ---
>>   src/inet.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/inet.c b/src/inet.c
>> index 80d96737..eb824c22 100644
>> --- a/src/inet.c
>> +++ b/src/inet.c
>> @@ -3212,10 +3212,14 @@ out:
>>     bool __connman_inet_isrootnfs_device(const char *devname)
>>   {
>> +       const char *pnp_file = "/proc/net/pnp";
>>         struct in_addr addr;
>>         char ifname[IFNAMSIZ];
>>   -     return get_nfs_server_ip(NULL, NULL, &addr) == 0 &&
>> +       if (!g_file_test(pnp_file, G_FILE_TEST_EXISTS))
>> +               return false;
>> +
>> +       return get_nfs_server_ip(NULL, pnp_file, &addr) == 0 &&
>
>
> I think we should fix it at the root of the problem. See my patch I just
> sent out.
>
> Thanks,
> Daniel


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

Message: 7
Date: Mon, 16 Apr 2018 20:33:13 +0200
From: Daniel Wagner <w...@monom.org>
To: Sonu Abraham <sonu.abra...@rfi.com.au>, "connman@lists.01.org"
        <connman@lists.01.org>
Subject: Re: Cellular Technology with Connmanctl working only after
        board reboot
Message-ID: <9c36f217-6e2e-b1b8-e72f-86f126427...@monom.org>
Content-Type: text/plain; charset=windows-1252; format=flowed

Hi Sonu,

On 04/10/2018 09:08 AM, Sonu Abraham wrote:
> Hi ,
> 
> I am trying to use Connman to enable cellular connectivity in one of our 
> embedded board.
> When i try to run the command for enabling cellular I get the following 
> error
> 
> *connmanctl> enable cellular
> Error cellular: Method "SetProperty" with signature "sv" on interface 
> "net.connman.Technology" doesn't exist
> *
> 
> 
> 
> I get the below output when listing technologies
> 
> *connmanctl technologies
> /net/connman/technology/p2p
>  ? Name = P2P
>  ? Type = p2p
>  ? Powered = False
>  ? Connected = False
>  ? Tethering = False
> /net/connman/technology/wifi
>  ? Name = WiFi
>  ? Type = wifi
>  ? Powered = True
>  ? Connected = False
>  ? Tethering = False
> /net/connman/technology/bluetooth
>  ? Name = Bluetooth
>  ? Type = bluetooth
>  ? Powered = False
>  ? Connected = False
>  ? Tethering = False
> /net/connman/technology/gadget
>  ? Name = Gadget
>  ? Type = gadget
>  ? Powered = True
>  ? Connected = False
>  ? Tethering = False
> /net/connman/technology/ethernet
>  ? Name = Wired
>  ? Type = ethernet
>  ? Powered = True
>  ? Connected = True
>  ? Tethering = False*

At this point, the 'cellular' technology is not available. The 
connmanctl should report this in a better way. The above message is not 
really helping. In other words, this says, 'no cellular network 
technology available'.

> If I reboot the board after this and run the same command again in 
> commanctl , the above command works
> 
> Can anyone suggest what could be going wrong ?

Hard to tell without logs. I understand you are running oFono in the 
background. So you need to check if oFono is working as expected with 
the given hardware.

> What are the methods to debug such a behavior ?

Run monitor-ofono and list-modems to see what oFono does.

> How to enable cellular technology when building? connman from source 
> code . I am using yocto for building the images for the target

IIRC you need to append 3g to the DISTRO_FEATURE variable to enable the 
support for modems.

Thanks,
Daniel


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

Subject: Digest Footer

_______________________________________________
connman mailing list
connman@lists.01.org
https://lists.01.org/mailman/listinfo/connman


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

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

Reply via email to