[PATCH] Fix some warnings due to GCC8's cast-function-type
by Peter Meerwald-Stadler
Reported by Ross Burton
gweb/giognutls.c: In function ‘g_io_gnutls_dispatch’:
gweb/giognutls.c:307:17: error: cast between incompatible function types from ‘GSourceFunc’ {aka ‘int (*)$
tools/session-utils.c: In function ‘util_test_add’:
tools/session-utils.c:234:4: error: cast between incompatible function types from ‘void (*)(const void *)$
(GTestFixtureFunc) run_test_cb,
tools/session-utils.c:235:4: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘$
(GTestFixtureFunc) g_free);
---
gweb/giognutls.c | 2 +-
tools/session-utils.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/gweb/giognutls.c b/gweb/giognutls.c
index c029a8b0..b5c476cb 100644
--- a/gweb/giognutls.c
+++ b/gweb/giognutls.c
@@ -304,7 +304,7 @@ static gboolean g_io_gnutls_dispatch(GSource *source, GSourceFunc callback,
gpointer user_data)
{
GIOGnuTLSWatch *watch = (GIOGnuTLSWatch *) source;
- GIOFunc func = (GIOFunc) callback;
+ GIOFunc func = (GIOFunc) (void (*) (void)) callback;
GIOCondition condition = watch->pollfd.revents;
DBG("source %p condition %u", source, condition);
diff --git a/tools/session-utils.c b/tools/session-utils.c
index 51cec5c3..77485f7c 100644
--- a/tools/session-utils.c
+++ b/tools/session-utils.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#pragma GCC diagnostic ignored "-Wcast-function-type"
#include <gdbus.h>
--
2.19.0
2 years, 6 months
[PATCH 0/3] VPN D-Bus property management fixes
by Jussi Laakkonen
This set of commits improves the management of VPN properties changed
over D-Bus. The properties, if changed, are saved accordingly now. The
routes provided via D-Bus are added into sorted list to allow checking
if they have changed and need to be saved.
Thanks to Slava Monich for pre-patch comments.
Jussi Laakkonen (3):
vpn: Read user routes from D-Bus message into sorted list
vpn: Save provider configuration when properties are changed
vpn: Save configuration only when a parameter has been changed
vpn/vpn-provider.c | 128 +++++++++++++++++++++++++++++++++++++++++----
1 file changed, 119 insertions(+), 9 deletions(-)
--
2.19.0
2 years, 6 months
Wrong state of a service if only IPv6 is enabled
by Marek Szanyi
Hi,
I have a device running connman v 1.35. For the Ethernet service if IPv4 is enabled or both IPv4 and IPv6 is enabled the state of the Ethernet service is reported correctly. Because the device have internet access the state is "online". However if I disable IPv4 and leave only IPv6 enabled the state of the service reported by connman is "idle", which is wrong, because I still have internet access (verified by using curl). Is this an expected behavior or is this a bug in connman?
Kind Regards,
Marek Szanyi
SW Developer
Kistler Bratislava, s.r.o.
Ševčenkova 34, 851 01 Bratislava, Slovakia
Direct+421232272624, Main Office+421 2 32 272 900
marek.szanyi(a)kistler.com, www.kistler.com
2 years, 6 months
Compile fail in giognutls.c
by Burton, Ross
If wispr is enabled I'm seeing this failure:
gweb/giognutls.c: In function 'g_io_gnutls_dispatch':
gweb/giognutls.c:307:17: error: cast between incompatible function
types from 'GSourceFunc' {aka 'int (*)(void *)'} to 'gboolean
(*)(GIOChannel *, GIOCondition, void *)' {aka 'int (*)(struct
_GIOChannel *, enum <anonymous>, void *)'}
[-Werror=cast-function-type]
GIOFunc func = (GIOFunc) callback;
^
We generally disable wispr so I only noticed this in a test build, but
thought I'd ping the list in case someone can fix the code quickly.
Ross
2 years, 6 months
Force disable a service
by Alexandru Vasiu
Hi,
I want to disable a service and to remain like that (even if I pull out the cable and I plug in) until I enable it (using DHCP or static method), without restarting connman daemon.
I tried with a config file in /var/lib/connman:
root:/var/lib/connman# cat interfaces.config
[service_00802F23CA1B]
MAC = 00:80:2F:23:CA:1B
Name = ethernet_cable_00802F23CA1B
IPv4 = off
and then I disconnected the service using disconnect command. The problem is that after I re-plug in the cable, connman ignores the config file and sets that interface using DHCP.
I also tried with NetworkInterfaceBlacklist from /etc/connman/main.conf, but this requires a restart of connmand.
Is there another solution to this issue?
Thank you,
Alex Vasiu
2 years, 6 months
[PATCH] vpn: Save provider configuration when properties are changed
by Jussi Laakkonen
This commit adds saving of provider configuration when a property
is added, changed or cleared via net.connman.vpn D-Bus interface
net.connman.vpn.Connection using SetProperty or ClearProperty
methods.
---
vpn/vpn-provider.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index dd54ac08..adc41754 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -91,6 +91,7 @@ struct vpn_provider {
static void append_properties(DBusMessageIter *iter,
struct vpn_provider *provider);
+static int vpn_provider_save(struct vpn_provider *provider);
static void free_route(gpointer data)
{
@@ -456,6 +457,8 @@ static DBusMessage *set_property(DBusConnection *conn, DBusMessage *msg,
vpn_provider_set_string(provider, name, str);
}
+ vpn_provider_save(provider);
+
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
@@ -484,6 +487,8 @@ static DBusMessage *clear_property(DBusConnection *conn, DBusMessage *msg,
return __connman_error_invalid_property(msg);
}
+ vpn_provider_save(provider);
+
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
--
2.11.0
2 years, 6 months
[PATCH 1/3] vpn: Use Connect2 method only when D-Bus sender is set
by Jussi Laakkonen
This fix addresses the issue of not being able to connect a VPN if it
has autoconnect set and connection is triggered by connmand. In such
case dbus_sender is not set and call to Connect2 method of
net.connman.vpn.Connection cannot be done.
Also, print correct D-Bus method called in case of error. If the
dbus_sender is not set or is empty Connect() will be used instead of
Connect2().
This amends changes of commit 3997c1595fe44d7c85215fd1cd89ecf778c62206.
---
plugins/vpn.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/plugins/vpn.c b/plugins/vpn.c
index 3d067a49..2064bfc0 100644
--- a/plugins/vpn.c
+++ b/plugins/vpn.c
@@ -546,15 +546,18 @@ static int connect_provider(struct connection_data *data, void *user_data,
#define VPN_CONNECT2 "Connect2"
/* We need to pass original dbus sender to connman-vpnd,
- * use a Connect2 method for that.
+ * use a Connect2 method for that if the original dbus sender is set.
+ * Connect method requires no parameter, Connect2 requires dbus sender
+ * name to be set.
*/
message = dbus_message_new_method_call(VPN_SERVICE, data->path,
VPN_CONNECTION_INTERFACE,
- VPN_CONNECT2);
+ dbus_sender && *dbus_sender ?
+ VPN_CONNECT2 : VPN_CONNECT);
if (!message)
return -ENOMEM;
- if (dbus_sender)
+ if (dbus_sender && *dbus_sender)
dbus_message_append_args(message, DBUS_TYPE_STRING,
&dbus_sender, NULL);
else
@@ -563,7 +566,8 @@ static int connect_provider(struct connection_data *data, void *user_data,
if (!dbus_connection_send_with_reply(connection, message,
&call, DBUS_TIMEOUT)) {
connman_error("Unable to call %s.%s()",
- VPN_CONNECTION_INTERFACE, VPN_CONNECT2);
+ VPN_CONNECTION_INTERFACE, dbus_sender && *dbus_sender ?
+ VPN_CONNECT2 : VPN_CONNECT);
dbus_message_unref(message);
return -EINVAL;
}
--
2.11.0
2 years, 6 months