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 v2] rtnl: retry to add ether interface after renaming
      (Dmitry Rozhkov)
   2. [PATCH] config: Memory leak in
      connman_config_provision_mutable_service (Slava Monich)


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

Message: 1
Date: Fri, 21 Apr 2017 11:04:01 +0300
From: Dmitry Rozhkov <[email protected]>
To: [email protected]
Subject: [PATCH v2] rtnl: retry to add ether interface after renaming
Message-ID: <[email protected]>

If eth* interfaces are blacklisted to avoid a race condition
where connman may access an interface before systemd/udev can
change it to use a predictable interface name then it's impossible
to re-activate it under a new predictable name because an existing
interface is considered to be already added to the technology.

Once blacklisted an interface is not re-evaluated under a new name.

This patch allows to re-evaluate an interface known to connman for
adding it to the ethernet technology in case it's name has changed.
E.g. after unplugging a cable and plugging it back.

Signed-off-by: Dmitry Rozhkov <[email protected]>
---

Changes in v2:
- before re-evaluation make sure the already known interface is
  of unknown device type which indicates that it has been
  blacklisted.

 src/rtnl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/rtnl.c b/src/rtnl.c
index 195368d..a094e25 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -471,7 +471,9 @@ static void process_newlink(unsigned short type, int index, 
unsigned flags,
 
                if (type == ARPHRD_ETHER)
                        read_uevent(interface);
-       } else
+       } else if (type == ARPHRD_ETHER && interface->device_type == 
CONNMAN_DEVICE_TYPE_UNKNOWN)
+               read_uevent(interface);
+       else
                interface = NULL;
 
        for (list = rtnl_list; list; list = list->next) {
-- 
2.9.3



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

Message: 2
Date: Fri, 21 Apr 2017 12:22:44 +0300
From: Slava Monich <[email protected]>
To: [email protected]
Subject: [PATCH] config: Memory leak in
        connman_config_provision_mutable_service
Message-ID: <[email protected]>

The value returned by g_key_file_get_start_group has to be
deallocated by the caller.
---
 src/config.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/config.c b/src/config.c
index a6e45ae..a8c3da8 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1559,7 +1559,7 @@ int connman_config_provision_mutable_service(GKeyFile 
*keyfile)
 {
        struct connman_config_service *service_config;
        struct connman_config *config;
-       char *vfile, *group;
+       char *vfile, *group = NULL;
        char rstr[11];
 
        DBG("");
@@ -1595,13 +1595,14 @@ int connman_config_provision_mutable_service(GKeyFile 
*keyfile)
        if (g_strcmp0(service_config->type, "wifi") == 0)
                __connman_device_request_scan(CONNMAN_SERVICE_TYPE_WIFI);
 
+       g_free(group);
        return 0;
 
 error:
        DBG("Could not proceed");
        g_hash_table_remove(config_table, vfile);
        g_free(vfile);
-
+       g_free(group);
        return -EINVAL;
 }
 
-- 
1.9.1



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

Subject: Digest Footer

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


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

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

Reply via email to