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 3/4] dhcp: Fixed Memory Leak (Saurav Babu)
   2. Re: [PATCH v3 4/4] service: Fixed Memory Leak (Patrik Flykt)
   3. Re: [PATCH v2 3/4] dhcp: Fixed Memory Leak (Patrik Flykt)
   4. [PATCH v2 1/4] gdbus: Fix Memory Leak (Patrik Flykt)
   5. [RFC] vpn: Restrict connman-vpnd capabilities (Patrik Flykt)
   6. Re: [PATCH 4/9] connmand-wait-online: Add command line
      options (Patrik Flykt)
   7. [PATCH v2 0/9] connmand-wait-online (Patrik Flykt)
   8. [PATCH v2 3/9] connmand-wait-online: Get Manager properties
      on startup (Patrik Flykt)
   9. [PATCH v2 5/9] connmand-wait-online: Add command line switch
      for interfaces (Patrik Flykt)


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

Message: 1
Date: Tue, 01 Dec 2015 17:39:33 +0530
From: Saurav Babu <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCH v2 3/4] dhcp: Fixed Memory Leak
Message-ID:
        <[email protected]>

Memory allocated should be feed when apply_lease_available_on_network()
fails
---
 src/dhcp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/dhcp.c b/src/dhcp.c
index 9a74362..e4497fc 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -462,11 +462,12 @@ static void lease_available_cb(GDHCPClient *dhcp_client, 
gpointer user_data)
        }
 
        if (!apply_lease_available_on_network(dhcp_client, dhcp))
-               return;
+               goto done;
 
        if (ip_change)
                dhcp_valid(dhcp);
 
+done:
        g_free(address);
        g_free(netmask);
        g_free(gateway);
-- 
1.9.1



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

Message: 2
Date: Tue, 01 Dec 2015 14:48:31 +0200
From: Patrik Flykt <[email protected]>
To: Saurav Babu <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH v3 4/4] service: Fixed Memory Leak
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"


        Hi,

On Tue, 2015-12-01 at 15:06 +0530, Saurav Babu wrote:
> When memory allocation fails for any value of j for servers[j] then all
> the memory allocated for 0 to j-1 should be freed alongwith servers
> ---
>  src/service.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/service.c b/src/service.c
> index e3317dd..1aced50 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -2732,8 +2732,12 @@ int __connman_service_timeserver_remove(struct 
> connman_service *service,
>       for (i = 0, j = 0; i < len; i++) {
>               if (g_strcmp0(service->timeservers[i], timeserver) != 0) {
>                       servers[j] = g_strdup(service->timeservers[i]);
> -                     if (!servers[j])
> +                     if (!servers[j]) {
> +                             while (j > 0)
> +                                     g_free(servers[--j]);
> +                             g_free(servers);
>                               return -ENOMEM;
> +                     }
>                       j++;
>               }
>       }

>From patch 2/4 it was noticed that the implementation of g_strdup() will
either work or terminate the program. So servers[j] will actually always
be set and no NULL checks are needed.

My bad, didn't notice this earlier.

        Patrik



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

Message: 3
Date: Tue, 01 Dec 2015 14:51:53 +0200
From: Patrik Flykt <[email protected]>
To: Saurav Babu <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH v2 3/4] dhcp: Fixed Memory Leak
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"

On Tue, 2015-12-01 at 17:39 +0530, Saurav Babu wrote:
> Memory allocated should be feed when apply_lease_available_on_network()
> fails

Applied, thanks!

        Patrik



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

Message: 4
Date: Tue, 01 Dec 2015 15:11:32 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Cc: connman <[email protected]>, "Von Dentz, Luiz"
        <[email protected]>
Subject: [PATCH v2 1/4] gdbus: Fix Memory Leak
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"

From: Saurav Babu <[email protected]>

Members of data are allocated memory but not freed only data is freed
---

        Hi,

This patch came up on the ConnMan mailing list, applies to Bluez too.

        Patrik


 gdbus/watch.c | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/gdbus/watch.c b/gdbus/watch.c
index b60f650..447e486 100644
--- a/gdbus/watch.c
+++ b/gdbus/watch.c
@@ -204,6 +204,30 @@ static gboolean remove_match(struct filter_data *data)
        return TRUE;
 }
 
+static void filter_data_free(struct filter_data *data)
+{
+       GSList *l;
+
+       /* Remove filter if there are no listeners left for the connection */
+       if (filter_data_find(data->connection) == NULL)
+               dbus_connection_remove_filter(data->connection, message_filter,
+                                                                       NULL);
+
+       for (l = data->callbacks; l != NULL; l = l->next)
+               g_free(l->data);
+
+       g_slist_free(data->callbacks);
+       g_dbus_remove_watch(data->connection, data->name_watch);
+       g_free(data->name);
+       g_free(data->owner);
+       g_free(data->path);
+       g_free(data->interface);
+       g_free(data->member);
+       g_free(data->argument);
+       dbus_connection_unref(data->connection);
+       g_free(data);
+}
+
 static struct filter_data *filter_data_get(DBusConnection *connection,
                                        DBusHandleMessageFunction filter,
                                        const char *sender,
@@ -248,7 +272,7 @@ proceed:
        data->argument = g_strdup(argument);
 
        if (!add_match(data, filter)) {
-               g_free(data);
+               filter_data_free(data);
                return NULL;
        }
 
@@ -277,30 +301,6 @@ static struct filter_callback *filter_data_find_callback(
        return NULL;
 }
 
-static void filter_data_free(struct filter_data *data)
-{
-       GSList *l;
-
-       /* Remove filter if there are no listeners left for the connection */
-       if (filter_data_find(data->connection) == NULL)
-               dbus_connection_remove_filter(data->connection, message_filter,
-                                                                       NULL);
-
-       for (l = data->callbacks; l != NULL; l = l->next)
-               g_free(l->data);
-
-       g_slist_free(data->callbacks);
-       g_dbus_remove_watch(data->connection, data->name_watch);
-       g_free(data->name);
-       g_free(data->owner);
-       g_free(data->path);
-       g_free(data->interface);
-       g_free(data->member);
-       g_free(data->argument);
-       dbus_connection_unref(data->connection);
-       g_free(data);
-}
-
 static void filter_data_call_and_free(struct filter_data *data)
 {
        GSList *l;
-- 
1.9.1

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




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

Message: 5
Date: Tue,  1 Dec 2015 15:32:27 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [RFC] vpn: Restrict connman-vpnd capabilities
Message-ID:
        <[email protected]>

Have systemd set /home and /run/users read only as VPN certificates can
be stored also in these directories. Protect other directories in the
system by making also them read only. The directory options affect also
all VPN applications started by connman-vpnd.

Restrict capabilities to a subset necessary for normal operations.
---

ProtectSystem=full means the VPN applications cannot write anything to
/usr or /etc. Let's hope this works out for all VPN daemons.

Please test,

       Patrik


 vpn/connman-vpn.service.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/vpn/connman-vpn.service.in b/vpn/connman-vpn.service.in
index 120245e..e98fb71 100644
--- a/vpn/connman-vpn.service.in
+++ b/vpn/connman-vpn.service.in
@@ -6,6 +6,9 @@ Type=dbus
 BusName=net.connman.vpn
 ExecStart=@sbindir@/connman-vpnd -n
 StandardOutput=null
+CapabilityBoundingSet=CAP_KILL CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
+ProtectHome=read-only
+ProtectSystem=full
 
 [Install]
 WantedBy=multi-user.target
-- 
2.1.4



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

Message: 6
Date: Tue, 01 Dec 2015 15:59:23 +0200
From: Patrik Flykt <[email protected]>
To: Peter Meerwald-Stadler <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 4/9] connmand-wait-online: Add command line
        options
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"


        Hi,

On Tue, 2015-11-24 at 14:18 +0100, Peter Meerwald-Stadler wrote:
> > +                   fprintf(stderr, ("An unknown error occurred\n"));
> 
> why the parenthesis?

No idea... :-)

> > +
> > +           return EOPNOTSUPP;
> > +   }
> > +
> > +        g_option_context_free(context);
> > +
> > +        if (option_version) {
> > +           fprintf(stdout, "%s\n", VERSION);
> > +           return 0;
> 
> EXIT_SUCCESS?

0 looks fine here and is in line with src/main.c.

> > +   }
> > +
> 
> drop extra newline

Done.

> >  
> >     dbus_error_init(&dbus_err);
> >     connection = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, &dbus_err);
> > 
> 
> -- 
> 
> Peter Meerwald-Stadler
> +43-664-2444418 (mobile)

Thanks,

        Patrik



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

Message: 7
Date: Tue,  1 Dec 2015 16:05:33 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH v2 0/9] connmand-wait-online
Message-ID:
        <[email protected]>


        Hi,

v2 of this patch updates patches 1/9 and 4/9 according to comments.

Cheers,

        Patrik


        Hi,

Here is a new systemd service which waits until ConnMan gets to 'ready'
or 'online' state by placing itself before systemd's network-online.target.
This will cause services needing network to be run after the network
is actually up instead of being started after ConnMan as is the case
right now.

Cheers,

        Patrik


Patrik Flykt (9):
  connmand-wait-online: Add program and initial main loop
  connmand-wait-online: Monitor Manager PropertyChanged signals
  connmand-wait-online: Get Manager properties on startup
  connmand-wait-online: Add command line options
  connmand-wait-online: Add command line switch for interfaces
  connmand-wait-online: Add option to ignore interfaces
  connmand-wait-online: Add timeout option
  build: Add connman-wait-online.service
  connman.service: Remove dependencies on remote-fs.target

 Makefile.am                        |  13 +-
 src/connman-wait-online.service.in |  15 ++
 src/connman.service.in             |   4 +-
 src/connmand-wait-online.c         | 461 +++++++++++++++++++++++++++++++++++++
 4 files changed, 488 insertions(+), 5 deletions(-)
 create mode 100644 src/connman-wait-online.service.in
 create mode 100644 src/connmand-wait-online.c

-- 
2.1.4



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

Message: 8
Date: Tue,  1 Dec 2015 16:05:36 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH v2 3/9] connmand-wait-online: Get Manager properties
        on startup
Message-ID:
        <[email protected]>

When starting, request Manager properties to detect if services are
already connected.
---
 src/connmand-wait-online.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/src/connmand-wait-online.c b/src/connmand-wait-online.c
index d572f8c..37394dc 100644
--- a/src/connmand-wait-online.c
+++ b/src/connmand-wait-online.c
@@ -65,6 +65,70 @@ static bool state_online(DBusMessageIter *iter)
        return true;
 }
 
+static void manager_properties_online(DBusMessageIter *iter)
+{
+       DBusMessageIter array, dict_entry;
+
+       if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY)
+               return;
+
+       for (dbus_message_iter_recurse(iter, &array);
+            dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_DICT_ENTRY;
+            dbus_message_iter_next(&array)) {
+
+               dbus_message_iter_recurse(&array, &dict_entry);
+
+               if (state_online(&dict_entry)) {
+                       g_main_loop_quit(main_loop);
+                       break;
+               }
+       }
+}
+
+static void manager_get_properties_return(DBusPendingCall *call, void 
*user_data)
+{
+       DBusMessage *reply;
+       DBusMessageIter iter;
+
+       reply = dbus_pending_call_steal_reply(call);
+       if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
+                goto fail;
+
+        if (!dbus_message_iter_init(reply, &iter))
+                goto fail;
+
+       manager_properties_online(&iter);
+
+fail:
+       dbus_message_unref(reply);
+       dbus_pending_call_unref(call);
+}
+
+static void manager_get_properties(void)
+{
+       DBusMessage *message;
+       DBusPendingCall *call;
+
+       message = dbus_message_new_method_call(CONNMAN_SERVICE,
+                                       CONNMAN_MANAGER_PATH,
+                                       CONNMAN_MANAGER_INTERFACE,
+                                       "GetProperties");
+       if (!message)
+               return;
+
+       if (!dbus_connection_send_with_reply(connection, message, &call, -1))
+                goto fail;
+
+        if (!call)
+                goto fail;
+
+       dbus_pending_call_set_notify(call, manager_get_properties_return,
+                               NULL, NULL);
+
+fail:
+        dbus_message_unref(message);
+}
+
 static DBusHandlerResult manager_property_changed(DBusConnection *connection,
                 DBusMessage *message, void *user_data)
 {
@@ -112,6 +176,8 @@ int main(int argc, char *argv[])
                goto cleanup;
        }
 
+       manager_get_properties();
+
        g_main_loop_run(main_loop);
 
 cleanup:
-- 
2.1.4



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

Message: 9
Date: Tue,  1 Dec 2015 16:05:38 +0200
From: Patrik Flykt <[email protected]>
To: [email protected]
Subject: [PATCH v2 5/9] connmand-wait-online: Add command line switch
        for interfaces
Message-ID:
        <[email protected]>

Add command line switch to specify one ore more interfaces to wait for before
deciding if the systemd is "online" in systemd terms.

Once the global Manager state is known to be online, request all services and
iterate over the service properties to find out if the service state is 'ready'
or 'online' for a service with the specified interface name.
---
 src/connmand-wait-online.c | 217 ++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 207 insertions(+), 10 deletions(-)

diff --git a/src/connmand-wait-online.c b/src/connmand-wait-online.c
index 9c77801..fc89df5 100644
--- a/src/connmand-wait-online.c
+++ b/src/connmand-wait-online.c
@@ -37,13 +37,34 @@ static DBusConnection *connection;
 static GMainLoop *main_loop;
 
 static gboolean option_version = FALSE;
+static gchar *option_interface = NULL;
+
+struct devices {
+       char **interface;
+};
 
 static GOptionEntry options[] = {
+       { "interface", 'i', 0, G_OPTION_ARG_STRING, &option_interface,
+         "Specify networking device or interface", "DEV" },
        { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
          "Show version information and exit" },
        { NULL },
 };
 
+static bool compare_interface(const char *interface, struct devices *devices)
+{
+       int i;
+
+       if (!interface || !devices)
+               return false;
+
+       for (i = 0; devices->interface[i]; i++)
+               if (!strcmp(interface, devices->interface[i]))
+                       return true;
+
+       return false;
+}
+
 static bool state_online(DBusMessageIter *iter)
 {
        char *str;
@@ -73,7 +94,165 @@ static bool state_online(DBusMessageIter *iter)
        return true;
 }
 
-static void manager_properties_online(DBusMessageIter *iter)
+static bool service_properties_online(DBusMessageIter *array_entry,
+                               struct devices *devices)
+{
+       bool interface = !devices;
+       bool state = false;
+       DBusMessageIter dict, dict_entry, variant, eth_array, eth_dict,
+               eth_variant;
+       char *str;
+
+       for (dbus_message_iter_recurse(array_entry, &dict);
+            dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY;
+            dbus_message_iter_next(&dict)) {
+
+               dbus_message_iter_recurse(&dict, &dict_entry);
+               if (dbus_message_iter_get_arg_type(&dict_entry)
+                               != DBUS_TYPE_STRING)
+                       continue;
+
+               if (state_online(&dict_entry)) {
+                       state = true;
+                       continue;
+               }
+
+               dbus_message_iter_recurse(&dict, &dict_entry);
+
+               dbus_message_iter_get_basic(&dict_entry, &str);
+
+               if (devices && !strcmp(str, "Ethernet")) {
+                       dbus_message_iter_next(&dict_entry);
+
+                       if (dbus_message_iter_get_arg_type(&dict_entry)
+                                       != DBUS_TYPE_VARIANT)
+                               break;
+
+                       dbus_message_iter_recurse(&dict_entry, &variant);
+                       if (dbus_message_iter_get_arg_type(&variant)
+                                       != DBUS_TYPE_ARRAY)
+                               break;
+
+                       for (dbus_message_iter_recurse(&variant, &eth_array);
+                            dbus_message_iter_get_arg_type(&eth_array)
+                                    == DBUS_TYPE_DICT_ENTRY;
+                            dbus_message_iter_next(&eth_array)) {
+
+                               dbus_message_iter_recurse(&eth_array, 
&eth_dict);
+
+                               if (dbus_message_iter_get_arg_type(&eth_dict)
+                                               != DBUS_TYPE_STRING)
+                                       continue;
+
+                               dbus_message_iter_get_basic(&eth_dict, &str);
+                               if (!strcmp(str, "Interface")) {
+
+                                       dbus_message_iter_next(&eth_dict);
+                                       if 
(dbus_message_iter_get_arg_type(&eth_dict)
+                                                       != DBUS_TYPE_VARIANT)
+                                               break;
+
+                                       dbus_message_iter_recurse(&eth_dict,
+                                                               &eth_variant);
+                                       if 
(dbus_message_iter_get_arg_type(&eth_variant)
+                                                       != DBUS_TYPE_STRING)
+                                               break;
+
+                                       
dbus_message_iter_get_basic(&eth_variant,
+                                                               &str);
+                                       interface = compare_interface(str,
+                                                               devices);
+
+                                       break;
+                               }
+                       }
+               }
+
+               if (state && interface) {
+                       g_main_loop_quit(main_loop);
+                       return true;
+               }
+       }
+
+       return false;
+}
+
+static void services_dict_online(DBusMessageIter *iter, struct devices 
*devices)
+{
+       DBusMessageIter array, array_entry;
+
+       if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY)
+               return;
+
+       for (dbus_message_iter_recurse(iter, &array);
+            dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRUCT;
+            dbus_message_iter_next(&array)) {
+
+               dbus_message_iter_recurse(&array, &array_entry);
+
+               if (dbus_message_iter_get_arg_type(&array_entry) !=
+                               DBUS_TYPE_OBJECT_PATH)
+                       break;
+
+               dbus_message_iter_next(&array_entry);
+
+               if (dbus_message_iter_get_arg_type(&array_entry) !=
+                               DBUS_TYPE_ARRAY)
+                       continue;
+
+               if (service_properties_online(&array_entry, devices))
+                       break;
+       }
+}
+
+static void manager_get_services_return(DBusPendingCall *call,
+                                       void *user_data)
+{
+       struct devices *devices = user_data;
+       DBusMessage *reply;
+       DBusMessageIter iter;
+
+       reply = dbus_pending_call_steal_reply(call);
+       if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
+                goto fail;
+
+        if (!dbus_message_iter_init(reply, &iter))
+                goto fail;
+
+       services_dict_online(&iter, devices);
+
+fail:
+       dbus_message_unref(reply);
+       dbus_pending_call_unref(call);
+}
+
+static void manager_get_services(struct devices *devices)
+{
+       DBusMessage *message;
+       DBusPendingCall *call;
+
+       message = dbus_message_new_method_call(CONNMAN_SERVICE,
+                                       CONNMAN_MANAGER_PATH,
+                                       CONNMAN_MANAGER_INTERFACE,
+                                       "GetServices");
+       if (!message)
+               return;
+
+       if (!dbus_connection_send_with_reply(connection, message, &call, -1))
+                goto fail;
+
+        if (!call)
+                goto fail;
+
+       dbus_pending_call_set_notify(call, manager_get_services_return,
+                               devices, NULL);
+
+fail:
+        dbus_message_unref(message);
+}
+
+static void manager_properties_online(DBusMessageIter *iter,
+                               struct devices *devices)
 {
        DBusMessageIter array, dict_entry;
 
@@ -87,7 +266,11 @@ static void manager_properties_online(DBusMessageIter *iter)
                dbus_message_iter_recurse(&array, &dict_entry);
 
                if (state_online(&dict_entry)) {
-                       g_main_loop_quit(main_loop);
+                       if (devices)
+                               manager_get_services(devices);
+                       else
+                               g_main_loop_quit(main_loop);
+
                        break;
                }
        }
@@ -95,6 +278,7 @@ static void manager_properties_online(DBusMessageIter *iter)
 
 static void manager_get_properties_return(DBusPendingCall *call, void 
*user_data)
 {
+       struct devices *devices = user_data;
        DBusMessage *reply;
        DBusMessageIter iter;
 
@@ -105,14 +289,14 @@ static void manager_get_properties_return(DBusPendingCall 
*call, void *user_data
         if (!dbus_message_iter_init(reply, &iter))
                 goto fail;
 
-       manager_properties_online(&iter);
+       manager_properties_online(&iter, devices);
 
 fail:
        dbus_message_unref(reply);
        dbus_pending_call_unref(call);
 }
 
-static void manager_get_properties(void)
+static void manager_get_properties(struct devices *devices)
 {
        DBusMessage *message;
        DBusPendingCall *call;
@@ -131,7 +315,7 @@ static void manager_get_properties(void)
                 goto fail;
 
        dbus_pending_call_set_notify(call, manager_get_properties_return,
-                               NULL, NULL);
+                               devices, NULL);
 
 fail:
         dbus_message_unref(message);
@@ -140,14 +324,19 @@ fail:
 static DBusHandlerResult manager_property_changed(DBusConnection *connection,
                 DBusMessage *message, void *user_data)
 {
+       struct devices *devices = user_data;
        DBusMessageIter iter;
 
        if (dbus_message_is_signal(message, CONNMAN_MANAGER_INTERFACE,
                                        "PropertyChanged")) {
                dbus_message_iter_init(message, &iter);
 
-               if (state_online(&iter))
-                       g_main_loop_quit(main_loop);
+               if (state_online(&iter)) {
+                       if (devices)
+                               manager_get_services(devices);
+                       else
+                               g_main_loop_quit(main_loop);
+               }
        }
 
        return DBUS_HANDLER_RESULT_HANDLED;
@@ -159,6 +348,7 @@ int main(int argc, char *argv[])
                CONNMAN_MANAGER_INTERFACE "'";
        int err = 0;
        GError *g_err = NULL;
+       struct devices devices = { NULL };
        DBusError dbus_err;
        GOptionContext *context;
 
@@ -177,6 +367,11 @@ int main(int argc, char *argv[])
 
         g_option_context_free(context);
 
+       if (option_interface) {
+               devices.interface = g_strsplit(option_interface, ",", -1);
+               g_free(option_interface);
+       }
+
         if (option_version) {
                fprintf(stdout, "%s\n", VERSION);
                goto free;
@@ -195,7 +390,7 @@ int main(int argc, char *argv[])
        main_loop = g_main_loop_new(NULL, FALSE);
 
        dbus_connection_add_filter(connection, manager_property_changed,
-                               NULL, NULL);
+                               &devices, NULL);
 
        dbus_bus_add_match(connection, filter, &dbus_err);
 
@@ -206,20 +401,22 @@ int main(int argc, char *argv[])
                goto cleanup;
        }
 
-       manager_get_properties();
+       manager_get_properties(&devices);
 
        g_main_loop_run(main_loop);
 
 cleanup:
        dbus_bus_remove_match(connection, filter, NULL);
        dbus_connection_remove_filter(connection, manager_property_changed,
-                               NULL);
+                               &devices);
 
        dbus_connection_unref(connection);
        g_main_loop_unref(main_loop);
 
 fail:
        dbus_error_free(&dbus_err);
+free:
+       g_strfreev(devices.interface);
 
        return -err;
 }
-- 
2.1.4



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

Subject: Digest Footer

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


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

End of connman Digest, Vol 2, Issue 2
*************************************

Reply via email to