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. [PATCH] fixed noisy error Cannot read /proc/net/pnp Failed to
      open file (Vasyl Vavrychuk)
   2. [PATCH] fixed noisy error File /proc/net/pnp doesn't exist
      (Vasyl Vavrychuk)
   3. Re: [PATCH] fixed noisy error File /proc/net/pnp doesn't
      exist (Vasyl Vavrychuk)
   4. [PATCH] fixed noisy error File /proc/net/pnp doesn't exist
      (Vasyl Vavrychuk)
   5. Re: [PATCH 07/27] Add Address Conflict Detection support (RFC
      5227) (Daniel Wagner)
   6. Re: [PATCH 10/27] acd: add functions start/stop_listening
      (Daniel Wagner)


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

Message: 1
Date: Mon, 16 Apr 2018 04:53:58 +0300
From: Vasyl Vavrychuk <vvavryc...@gmail.com>
To: Daniel Wagner <w...@monom.org>,     connman@lists.01.org
Subject: [PATCH] fixed noisy error Cannot read /proc/net/pnp Failed to
        open file
Message-ID: <20180416015358.23674-1-vvavryc...@gmail.com>

This error happend on every boot.
---
 src/inet.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/inet.c b/src/inet.c
index dcd1ab24..80d96737 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -3233,6 +3233,9 @@ char **__connman_inet_get_pnp_nameservers(const char 
*pnp_file)
        if (!pnp_file)
                pnp_file = "/proc/net/pnp";
 
+       if (!g_file_test(pnp_file, G_FILE_TEST_EXISTS))
+               goto out;
+
        if (!g_file_get_contents(pnp_file, &pnp, NULL, &error)) {
                connman_error("%s: Cannot read %s %s\n", __func__,
                                pnp_file, error->message);
-- 
2.11.0



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

Message: 2
Date: Mon, 16 Apr 2018 05:06:31 +0300
From: Vasyl Vavrychuk <vvavryc...@gmail.com>
To: Daniel Wagner <w...@monom.org>,     connman@lists.01.org
Subject: [PATCH] fixed noisy error File /proc/net/pnp doesn't exist
Message-ID: <20180416020631.25653-1-vvavryc...@gmail.com>

It happend on every boot.
---
 src/inet.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/inet.c b/src/inet.c
index 80d96737..dc38a8af 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -3212,9 +3212,13 @@ out:
 
 bool __connman_inet_isrootnfs_device(const char *devname)
 {
+       const char *pnp_file = "/proc/net/pnp";
        struct in_addr addr;
        char ifname[IFNAMSIZ];
 
+       if (!g_file_test(pnp_file, G_FILE_TEST_EXISTS))
+               return false;
+
        return get_nfs_server_ip(NULL, NULL, &addr) == 0 &&
               get_peer_iface(&addr, ifname) == 0 &&
               strcmp(devname, ifname) == 0;
-- 
2.11.0



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

Message: 3
Date: Mon, 16 Apr 2018 14:18:40 +0300
From: Vasyl Vavrychuk <vvavryc...@gmail.com>
To: Daniel Wagner <w...@monom.org>, connman@lists.01.org
Subject: Re: [PATCH] fixed noisy error File /proc/net/pnp doesn't
        exist
Message-ID:
        <CAGj4m+5ODZiADmij5oGw=gRnG98qC_j5cd25egcqU5yWxdj=s...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Please ignore this patch. I will prepare a new one.

On Mon, Apr 16, 2018 at 5:06 AM, Vasyl Vavrychuk <vvavryc...@gmail.com> wrote:
> It happend on every boot.
> ---
>  src/inet.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/inet.c b/src/inet.c
> index 80d96737..dc38a8af 100644
> --- a/src/inet.c
> +++ b/src/inet.c
> @@ -3212,9 +3212,13 @@ out:
>
>  bool __connman_inet_isrootnfs_device(const char *devname)
>  {
> +       const char *pnp_file = "/proc/net/pnp";
>         struct in_addr addr;
>         char ifname[IFNAMSIZ];
>
> +       if (!g_file_test(pnp_file, G_FILE_TEST_EXISTS))
> +               return false;
> +
>         return get_nfs_server_ip(NULL, NULL, &addr) == 0 &&
>                get_peer_iface(&addr, ifname) == 0 &&
>                strcmp(devname, ifname) == 0;
> --
> 2.11.0
>


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

Message: 4
Date: Mon, 16 Apr 2018 14:19:06 +0300
From: Vasyl Vavrychuk <vvavryc...@gmail.com>
To: Daniel Wagner <w...@monom.org>,     connman@lists.01.org
Subject: [PATCH] fixed noisy error File /proc/net/pnp doesn't exist
Message-ID: <20180416111906.12784-1-vvavryc...@gmail.com>

It happend on every boot.
---
 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 &&
               get_peer_iface(&addr, ifname) == 0 &&
               strcmp(devname, ifname) == 0;
 }
-- 
2.11.0



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

Message: 5
Date: Mon, 16 Apr 2018 16:22:31 +0200
From: Daniel Wagner <w...@monom.org>
To: Christian Spielberger <christian.spielber...@gmail.com>
Cc: connman@lists.01.org
Subject: Re: [PATCH 07/27] Add Address Conflict Detection support (RFC
        5227)
Message-ID: <f1861961-bed5-0558-daf8-79d88b634...@monom.org>
Content-Type: text/plain; charset=utf-8

Hi Christian,

On 04/11/2018 04:00 PM, Christian Spielberger wrote:
> Add first acd.h, acd.c, a configuration ACD on/off switch and a first
> version of start_acd in network.c which does nothing for the moment.
> ---
>   Makefile.am   |  6 ++++--
>   include/acd.h | 38 ++++++++++++++++++++++++++++++++++++++
>   src/acd.c     | 19 +++++++++++++++++++
>   src/main.c    | 13 +++++++++++++
>   src/network.c | 38 ++++++++++++++++++++++++++++++++++++++
>   5 files changed, 112 insertions(+), 2 deletions(-)
>   create mode 100644 include/acd.h
>   create mode 100644 src/acd.c
> 
> diff --git a/Makefile.am b/Makefile.am
> index aa58691..1e54d88 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -11,7 +11,8 @@ include_HEADERS = include/log.h include/plugin.h \
>                       include/device.h include/network.h include/inet.h \
>                       include/storage.h include/provision.h \
>                       include/session.h include/ipaddress.h include/agent.h \
> -                     include/inotify.h include/peer.h include/machine.h
> +                     include/inotify.h include/peer.h include/machine.h \
> +                     include/acd.h
>   
>   nodist_include_HEADERS = include/version.h
>   
> @@ -125,7 +126,8 @@ src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) 
> $(backtrace_sources) \
>                       src/stats.c src/6to4.c \
>                       src/ippool.c src/bridge.c src/nat.c src/ipaddress.c \
>                       src/inotify.c src/ipv6pd.c src/peer.c \
> -                     src/peer_service.c src/machine.c src/util.c
> +                     src/peer_service.c src/machine.c src/util.c \
> +                     src/acd.c

This hunk doesn't apply. It looks like it collides with the recent
1946bbe055d1 ("build: Add --disable-stats option") change. Can you 
please rebase your series. 

>   
>   if INTERNAL_DNS_BACKEND
>   src_connmand_SOURCES += src/dnsproxy.c
> diff --git a/include/acd.h b/include/acd.h
> new file mode 100644
> index 0000000..c347d77
> --- /dev/null
> +++ b/include/acd.h
> @@ -0,0 +1,38 @@
> +/*
> + *
> + *  Connection Manager
> + *
> + *  Address Conflict Detection (RFC 5227)

Please move the comment to its own section. The idea is to separate the
comments from the copyright statements.

> + *
> + *  based on DHCP client library with GLib integration,
> + *      Copyright (C) 2009-2014  Intel Corporation. All rights reserved.
> + *
> + *  Copyright (C) 2018  Commend International. All rights reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License version 2 as
> + *  published by the Free Software Foundation.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + */
> +
> +#ifndef __CONNMAN_ACD_H
> +#define __CONNMAN_ACD_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +struct _acd_host;

Just call it 'struct acd_host', because

> +
> +typedef struct _acd_host acd_host;

we follow the kernel coding style. That's why we don't do typedef for structs. 
see 

https://www.kernel.org/doc/html/v4.10/process/coding-style.html#typedefs

and doc/coding-style.txt

"""
First of all, ConnMan coding style must follow every rule for Linux kernel
(http://www.kernel.org/doc/Documentation/CodingStyle). There also exists a tool
named checkpatch.pl to help you check the compliance with it. Just type
"checkpatch.pl --no-tree patch_name" to check your patch. In theory, you need
to clean up all the warnings and errors except this one: "ERROR: Missing
Signed-off-by: line(s)". ConnMan does not used Signed-Off lines, so including
them is actually an error.  In certain circumstances one can ignore the 80
character per line limit.  This is generally only allowed if the alternative
would make the code even less readable.
"""

> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* __CONNMAN_ACD_H */
> diff --git a/src/acd.c b/src/acd.c
> new file mode 100644
> index 0000000..1653d2f
> --- /dev/null
> +++ b/src/acd.c
> @@ -0,0 +1,19 @@
> +/*
> + *
> + *  Connection Manager
> + *
> + *  Address Conflict Detection (ACD) RFC 5227

see above

> + *
> + *  Copyright (C) 2018  Commend International GmbH. All rights reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License version 2 as
> + *  published by the Free Software Foundation.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + */
> +
> diff --git a/src/main.c b/src/main.c
> index dda54bb..4a07d60 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -82,6 +82,7 @@ static struct {
>       char *vendor_class_id;
>       bool enable_online_check;
>       bool auto_connect_roaming_services;
> +     bool acd;
>   } connman_settings  = {
>       .bg_scan = true,
>       .pref_timeservers = NULL,
> @@ -101,6 +102,7 @@ static struct {
>       .vendor_class_id = NULL,
>       .enable_online_check = true,
>       .auto_connect_roaming_services = false,
> +     .acd = false,
>   };
>   
>   #define CONF_BG_SCAN                    "BackgroundScanning"
> @@ -121,6 +123,7 @@ static struct {
>   #define CONF_VENDOR_CLASS_ID            "VendorClassID"
>   #define CONF_ENABLE_ONLINE_CHECK        "EnableOnlineCheck"
>   #define CONF_AUTO_CONNECT_ROAMING_SERVICES "AutoConnectRoamingServices"
> +#define CONF_ACD                        "AddressConflictDetection"
>   
>   static const char *supported_options[] = {
>       CONF_BG_SCAN,
> @@ -141,6 +144,7 @@ static const char *supported_options[] = {
>       CONF_VENDOR_CLASS_ID,
>       CONF_ENABLE_ONLINE_CHECK,
>       CONF_AUTO_CONNECT_ROAMING_SERVICES,
> +     CONF_ACD,
>       NULL
>   };
>   
> @@ -432,6 +436,12 @@ static void parse_config(GKeyFile *config)
>               connman_settings.auto_connect_roaming_services = boolean;
>   
>       g_clear_error(&error);
> +
> +     boolean = __connman_config_get_bool(config, "General", CONF_ACD, 
> &error);
> +     if (!error)
> +             connman_settings.acd = boolean;
> +
> +     g_clear_error(&error);
>   }
>   
>   static int config_init(const char *file)
> @@ -645,6 +655,9 @@ bool connman_setting_get_bool(const char *key)
>       if (g_str_equal(key, CONF_AUTO_CONNECT_ROAMING_SERVICES))
>               return connman_settings.auto_connect_roaming_services;
>   
> +     if (g_str_equal(key, CONF_ACD))
> +             return connman_settings.acd;
> +
>       return false;
>   }
>   
> diff --git a/src/network.c b/src/network.c
> index 4757d0d..6df1d01 100644
> --- a/src/network.c
> +++ b/src/network.c
> @@ -26,6 +26,7 @@
>   #include <errno.h>
>   #include <string.h>
>   
> +#include <connman/acd.h>
>   #include "connman.h"

Add the include after "connman.h". The order is 

#include <config.h>

#include [standard c headers].h"

#include "connman.h"
#include <connman/[connman headers].h>


Thanks,
Daniel


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

Message: 6
Date: Mon, 16 Apr 2018 16:26:06 +0200
From: Daniel Wagner <w...@monom.org>
To: Christian Spielberger <christian.spielber...@gmail.com>
Cc: connman@lists.01.org
Subject: Re: [PATCH 10/27] acd: add functions start/stop_listening
Message-ID: <3f798260-e797-e9cf-3c3f-6a78a7b0e...@monom.org>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Hi Christian,

On 04/11/2018 04:00 PM, Christian Spielberger wrote:
> Adds functions for starting and stopping of the ARP listening which is 
> essential
> for ACD. Adds also the callback function for processing received ARP packets
> which does nothing for the moment.

This patch doesn't compile all in my testing:


src/acd.c: In function ?debug?:
src/acd.c:64:6: error: implicit declaration of function ?vsnprintf? 
[-Werror=implicit-function-declaration]
  if (vsnprintf(str, sizeof(str), format, ap) > 0)
      ^~~~~~~~~
src/acd.c: At top level:
src/acd.c:55:12: error: ?acd_recv_arp_packet? used but never defined [-Werror]
 static int acd_recv_arp_packet(acd_host *acd);
            ^~~~~~~~~~~~~~~~~~~
src/acd.c:148:13: error: ?stop_listening? defined but not used 
[-Werror=unused-function]
 static void stop_listening(acd_host *acd)
             ^~~~~~~~~~~~~~
src/acd.c:113:12: error: ?start_listening? defined but not used 
[-Werror=unused-function]
 static int start_listening(acd_host *acd)
            ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:4085: src/src_connmand-acd.o] Error 1
make[1]: *** Waiting for unfinished jobs....
  GEN      doc/connman-vpn.8
make: *** [Makefile:1665: all] Error 2
warning: execution failed: build-connman.sh
You can fix the problem, and then run


My build test command is

$ git rebase -i master --exec=build-connman.sh

Thanks,
Danie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build-connman.sh
Type: application/x-shellscript
Size: 275 bytes
Desc: not available
URL: 
<http://lists.01.org/pipermail/connman/attachments/20180416/bd9d34d2/attachment.sh>
-------------- next part --------------
#!/bin/sh
set -euo pipefail
IFS=$'\n\t'

usage() { echo "Usage: $0 [iwd]" 1>&2; exit 1; }

while getopts "h" o; do
    case "${o}" in
        *)
            usage
            ;;
    esac
done
shift $((OPTIND-1))

cmd=${1:-}

config_hwsim()
{
    ./bootstrap && \
        ./configure     --enable-maintainer-mode \
                        --enable-debug \
                        --disable-optimization \
                        --prefix=/usr \
                        --mandir=/usr/share/man \
                        --localstatedir=/var \
                        --sysconfdir=/etc \
                        --enable-loopback \
                        --enable-ethernet \
                        --disable-gadget \
                        --disable-wifi \
                        --disable-iwd \
                        --disable-bluetooth \
                        --disable-ofono \
                        --disable-neard \
                        --disable-datafiles \
                        --enable-hwsim $*
}

config_iwd()
{
    ./bootstrap && \
        ./configure     --enable-maintainer-mode \
                        --enable-debug \
                        --disable-optimization \
                        --prefix=/usr \
                        --mandir=/usr/share/man \
                        --localstatedir=/var \
                        --sysconfdir=/etc \
                        --disable-datafiles \
                        --with-firewall=nftables \
                        --enable-openconnect=builtin \
                        --enable-openvpn=builtin \
                        --enable-vpnc=builtin \
                        --enable-session-policy-local=builtin \
                        --enable-nmcompat \
                        --enable-iwd \
                        --disable-wifi \
                        --enable-polkit $*
}

config_wpas()
{
    ./bootstrap && \
        ./configure     --enable-debug \
                        --disable-optimization \
                        --prefix=/usr \
                        --mandir=/usr/share/man \
                        --localstatedir=/var \
                        --sysconfdir=/etc \
                        --disable-datafiles \
                        --with-firewall=nftables \
                        --enable-openvpn=builtin \
                        --enable-session-policy-local=builtin \
                        --enable-nmcompat \
                        --disable-iwd \
                        --enable-wifi \
                        --with-dns-backend=internal \
                        $*
}

if [ -f config.status ]; then
        make maintainer-clean
fi

if [ -z "$cmd" ] ; then
    cmd="iwd"
fi

case $cmd in
    "wpas")
        config_wpas
        ;;
    "iwd")
        config_iwd
        ;;
    "hwsim")
        config_hwsim
        ;;
    *)
        usage
        ;;
esac

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

Subject: Digest Footer

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


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

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

Reply via email to