diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-10-13 17:23:34 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-10-13 17:39:56 +0200 |
commit | 034f07787dc68fe1f81662d537c9baf81302a573 (patch) | |
tree | 231f7fa278dceddfbaffa82463ede9bd44740d8e /src/nm-pacrunner-manager.c | |
parent | db9589f0ceb099d49439acf257f9ef449aec2c27 (diff) | |
download | NetworkManager-034f07787dc68fe1f81662d537c9baf81302a573.tar.gz |
pacrunner: accept NULL interface name
Pacrunner uses the interface information to implement a myIpAddress()
function which returns the first IPv4 address of the interface
associated to a proxy. That function doesn't deal with multiple
addresses per interface, and so in case of a VPN which configures
addresses on the parent interface (e.g. IPsec), we currently pass a
NULL interface. That is correct, but triggers the following assertion:
GLib-CRITICAL **: g_variant_new_variant: assertion 'value != NULL' failed
#0 g_logv () from target:/lib64/libglib-2.0.so.0
#1 g_log () from target:/lib64/libglib-2.0.so.0
#2 g_variant_new_string () from target:/lib64/libglib-2.0.so.0
#3 nm_pacrunner_manager_send (self=0xab3230, iface=iface@entry=0x0, proxy_config=proxy_config@entry=0xc83470, ip4_config=ip4_config@entry=0x7f66b4002710, ip6_config=ip6_config@entry=0x0) at nm-pacrunner-manager.c:334
#4 _set_vpn_state (self=self@entry=0xd0c120, vpn_state=vpn_state@entry=STATE_ACTIVATED, reason=reason@entry=NM_VPN_CONNECTION_STATE_REASON_NONE, quitting=quitting@entry=0) at vpn-manager/nm-vpn-connection.c:571
#5 dispatcher_pre_up_done (call_id=<optimized out>, user_data=<optimized out>) at vpn-manager/nm-vpn-connection.c:460
#6 dispatcher_done_cb (proxy=0x988870, result=<optimized out>, user_data=0xae1740) at nm-dispatcher.c:444
Ignore the interface parameter when it's NULL.
Diffstat (limited to 'src/nm-pacrunner-manager.c')
-rw-r--r-- | src/nm-pacrunner-manager.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nm-pacrunner-manager.c b/src/nm-pacrunner-manager.c index 66fe589e79..fc83f2078c 100644 --- a/src/nm-pacrunner-manager.c +++ b/src/nm-pacrunner-manager.c @@ -331,9 +331,11 @@ nm_pacrunner_manager_send (NMPacrunnerManager *self, g_variant_builder_init (&proxy_data, G_VARIANT_TYPE_VARDICT); - g_variant_builder_add (&proxy_data, "{sv}", - "Interface", - g_variant_new_string (iface)); + if (iface) { + g_variant_builder_add (&proxy_data, "{sv}", + "Interface", + g_variant_new_string (iface)); + } method = nm_proxy_config_get_method (proxy_config); switch (method) { |