dispatcher: enhance dispatcher script environment (bgo #648382)
For VPN connections, the interface name would be that of the VPN's IP interface, but the script environment would be the that of the VPN's parent device. Enhance the environment by adding any VPN specific details as additional environment variables prefixed by "VPN_". Leave the existing environment setup intact for backwards compatiblity. Additionally, the dispatcher never got updated for IPv6 support, so push IPv6 configuration and DHCPv6 configuration into the environment too. Even better, push everything the dispatcher needs to it instead of making the dispatcher make D-Bus requests back to NM, which sometimes fails if NM has already torn down the device or the connection which the device was using. And add some testcases to ensure that we don't break backwards compat, the testcases here were grabbed from a 0.8.4 machine with a hacked up dispatcher to dump everything it was given from NM.
This commit is contained in:
@@ -45,7 +45,9 @@ void nm_utils_merge_ip6_config (NMIP6Config *ip6_config, NMSettingIP6Config *set
|
||||
void nm_utils_call_dispatcher (const char *action,
|
||||
NMConnection *connection,
|
||||
NMDevice *device,
|
||||
const char *vpn_iface);
|
||||
const char *vpn_iface,
|
||||
NMIP4Config *vpn_ip4_config,
|
||||
NMIP6Config *vpn_ip6_config);
|
||||
|
||||
gboolean nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr);
|
||||
gboolean nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels);
|
||||
@@ -72,6 +74,12 @@ void value_hash_add_bool (GHashTable *hash,
|
||||
const char *key,
|
||||
gboolean val);
|
||||
|
||||
void value_hash_add_object_property (GHashTable *hash,
|
||||
const char *key,
|
||||
GObject *object,
|
||||
const char *prop,
|
||||
GType val_type);
|
||||
|
||||
gboolean nm_utils_do_sysctl (const char *path, const char *value);
|
||||
|
||||
gboolean nm_utils_get_proc_sys_net_value (const char *path,
|
||||
|
Reference in New Issue
Block a user