network-manager-openvpn calls openvpn with the "--up /usr/lib/network-manager-openvpn/nm-openvpn-service-openvpn-helper" and "--up-restart" parameters. This means that nm-openvpn-service-openvpn-helper will be called when the VPN is initiated ("init" parameter) and restarted ("restart" parameter).
However the environment passed to the script is slightly different in the init and the restart cases. In particular, the "ifconfig_local" environment variable is apparently not set on the restart call.
nm-openvpn-service-openvpn-helper fails if that env var is not set (in file src/nm-openvpn-service-openvpn-helper.c):
val = addr_to_gvalue (getenv ("ifconfig_local"));
if (val) g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS, val);
else helper_failed (connection, "IP4 Address");
One way to avoid this is to drop the else helper_failed (like in the ifconfig_remote case that follows)...
Analysis:
network- manager- openvpn calls openvpn with the "--up /usr/lib/ network- manager- openvpn/ nm-openvpn- service- openvpn- helper" and "--up-restart" parameters. This means that nm-openvpn- service- openvpn- helper will be called when the VPN is initiated ("init" parameter) and restarted ("restart" parameter).
However the environment passed to the script is slightly different in the init and the restart cases. In particular, the "ifconfig_local" environment variable is apparently not set on the restart call.
nm-openvpn- service- openvpn- helper fails if that env var is not set (in file src/nm- openvpn- service- openvpn- helper. c): local") );
g_hash_ table_insert (config, NM_VPN_ PLUGIN_ IP4_CONFIG_ ADDRESS, val);
helper_ failed (connection, "IP4 Address");
val = addr_to_gvalue (getenv ("ifconfig_
if (val)
else
One way to avoid this is to drop the else helper_failed (like in the ifconfig_remote case that follows)...