diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2014-11-19 13:03:38 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2014-11-19 16:52:25 +0100 |
commit | 9a133787536452cc8e471efe6bc0c94e5ad43383 (patch) | |
tree | c235f0e0576062021869e3dd9f917e1d51674afc | |
parent | c30379e0fd82146da29edb4b4753d7afb4d7e4bf (diff) | |
download | NetworkManager-9a133787536452cc8e471efe6bc0c94e5ad43383.tar.gz |
dispatcher: introduce new env variables for gateway address (bgo #740363)
IP4_GATEWAY
VPN_IP4_GATEWAY
IP6_GATEWAY
VPN_IP6_GATEWAY
We still put gateway into IP[46]_ADDRESS_N for backward compatibility.
https://bugzilla.gnome.org/show_bug.cgi?id=740363
-rw-r--r-- | callouts/nm-dispatcher-utils.c | 8 | ||||
-rw-r--r-- | man/NetworkManager.xml | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/callouts/nm-dispatcher-utils.c b/callouts/nm-dispatcher-utils.c index ab7fda660e..5b1419db1b 100644 --- a/callouts/nm-dispatcher-utils.c +++ b/callouts/nm-dispatcher-utils.c @@ -123,6 +123,10 @@ construct_ip4_items (GSList *items, GVariant *ip4_config, const char *prefix) } if (addresses->len) items = g_slist_prepend (items, g_strdup_printf ("%sIP4_NUM_ADDRESSES=%d", prefix, addresses->len)); + + /* Write gateway to a separate variable, too. */ + items = g_slist_prepend (items, g_strdup_printf ("%sIP4_GATEWAY=%s", prefix, gateway)); + g_ptr_array_unref (addresses); g_free (gateway); g_variant_unref (val); @@ -257,6 +261,10 @@ construct_ip6_items (GSList *items, GVariant *ip6_config, const char *prefix) } if (addresses->len) items = g_slist_prepend (items, g_strdup_printf ("%sIP6_NUM_ADDRESSES=%d", prefix, addresses->len)); + + /* Write gateway to a separate variable, too. */ + items = g_slist_prepend (items, g_strdup_printf ("%sIP6_GATEWAY=%s", prefix, gateway)); + g_ptr_array_unref (addresses); g_free (gateway); g_variant_unref (val); diff --git a/man/NetworkManager.xml b/man/NetworkManager.xml index 229c390cdc..78b52e3b5e 100644 --- a/man/NetworkManager.xml +++ b/man/NetworkManager.xml @@ -182,7 +182,8 @@ <term><varname>IP4_ADDRESS_N</varname></term> <listitem><para> The IPv4 address in the format "address/prefix gateway", where N is a number - from 0 to (# IPv4 address \- 1). + from 0 to (# IPv4 address \- 1). gateway item in this variable is deprecated, + use IP4_GATEWAY instead. </para></listitem> </varlistentry> <varlistentry> @@ -192,6 +193,12 @@ </para></listitem> </varlistentry> <varlistentry> + <term><varname>IP4_GATEWAY</varname></term> + <listitem><para> + The gateway IPv4 address in traditional numbers-and-dots notation. + </para></listitem> + </varlistentry> + <varlistentry> <term><varname>IP4_ROUTE_N</varname></term> <listitem><para> The IPv4 route in the format "address/prefix next-hop metric", where N is a number |