mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 04:40:13 +01:00
2008-10-14 Dan Williams <dcbw@redhat.com>
* src/nm-pptp-pppd-plugin.c - (nm_ip_up): pass VPN gateway up to nm-pptp-service git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4180 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
7a4cb4254e
commit
b48f50f166
2 changed files with 22 additions and 17 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2008-10-14 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-pptp-pppd-plugin.c
|
||||
- (nm_ip_up): pass VPN gateway up to nm-pptp-service
|
||||
|
||||
2008-10-12 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Patch from Bin Li <libin.charles@gmail.com>, based on patches by Tambet
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ value_destroy (gpointer data)
|
|||
static void
|
||||
nm_ip_up (void *data, int arg)
|
||||
{
|
||||
guint32 pppd_made_up_address = htonl (0x0a404040 + ifunit);
|
||||
ipcp_options opts = ipcp_gotoptions[0];
|
||||
ipcp_options peer_opts = ipcp_hisoptions[0];
|
||||
GHashTable *hash;
|
||||
|
|
@ -173,6 +174,22 @@ nm_ip_up (void *data, int arg)
|
|||
g_hash_table_insert (hash, NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV,
|
||||
str_to_gvalue (ifname));
|
||||
|
||||
/* Prefer the peer options remote address first, _unless_ pppd made the
|
||||
* address up, at which point prefer the local options remote address,
|
||||
* and if that's not right, use the made-up address as a last resort.
|
||||
*/
|
||||
if (peer_opts.hisaddr && (peer_opts.hisaddr != pppd_made_up_address)) {
|
||||
g_hash_table_insert (hash, NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY,
|
||||
uint_to_gvalue (peer_opts.hisaddr));
|
||||
} else if (opts.hisaddr) {
|
||||
g_hash_table_insert (hash, NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY,
|
||||
uint_to_gvalue (opts.hisaddr));
|
||||
} else if (peer_opts.hisaddr == pppd_made_up_address) {
|
||||
/* As a last resort, use the made-up address */
|
||||
g_hash_table_insert (hash, NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY,
|
||||
uint_to_gvalue (peer_opts.hisaddr));
|
||||
}
|
||||
|
||||
g_hash_table_insert (hash, NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS,
|
||||
uint_to_gvalue (opts.ouraddr));
|
||||
|
||||
|
|
@ -193,23 +210,6 @@ nm_ip_up (void *data, int arg)
|
|||
g_hash_table_insert (hash, NM_VPN_PLUGIN_IP4_CONFIG_DNS, val);
|
||||
}
|
||||
|
||||
/*
|
||||
if (opts.winsaddr[0] || opts.winsaddr[1]) {
|
||||
array = g_array_new (FALSE, FALSE, sizeof (guint32));
|
||||
|
||||
if (opts.winsaddr[0])
|
||||
g_array_append_val (array, opts.winsaddr[0]);
|
||||
if (opts.winsaddr[1])
|
||||
g_array_append_val (array, opts.winsaddr[1]);
|
||||
|
||||
val = g_slice_new0 (GValue);
|
||||
g_value_init (val, DBUS_TYPE_G_UINT_ARRAY);
|
||||
g_value_set_boxed (val, array);
|
||||
|
||||
g_hash_table_insert (hash, NM_VPN_PLUGIN_IP4_CONFIG_WINS, val);
|
||||
}
|
||||
*/
|
||||
|
||||
dbus_g_proxy_call_no_reply (proxy, "SetIp4Config",
|
||||
DBUS_TYPE_G_MAP_OF_VARIANT, hash, G_TYPE_INVALID,
|
||||
G_TYPE_INVALID);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue