mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-18 03:50:48 +02:00
2008-03-06 Dan Williams <dcbw@redhat.com>
* src/nm-vpnc-service-vpnc-helper.c - (main): pass the MTU in the returned option hash table git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3376 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
529a246913
commit
e97fc3c8f8
2 changed files with 26 additions and 5 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2008-03-06 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-vpnc-service-vpnc-helper.c
|
||||
- (main): pass the MTU in the returned option hash table
|
||||
|
||||
2007-12-31 Christopher Aillon <caillon@redhat.com>
|
||||
|
||||
* src/nm-vpnc-service.h:
|
||||
|
|
|
|||
|
|
@ -113,6 +113,21 @@ str_to_gvalue (const char *str, gboolean try_convert)
|
|||
return val;
|
||||
}
|
||||
|
||||
static GValue *
|
||||
uint_to_gvalue (guint32 num)
|
||||
{
|
||||
GValue *val;
|
||||
|
||||
if (num == 0)
|
||||
return NULL;
|
||||
|
||||
val = g_slice_new0 (GValue);
|
||||
g_value_init (val, G_TYPE_UINT);
|
||||
g_value_set_uint (val, num);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static GValue *
|
||||
addr_to_gvalue (const char *str)
|
||||
{
|
||||
|
|
@ -126,11 +141,7 @@ addr_to_gvalue (const char *str)
|
|||
if (!inet_aton (str, &temp_addr))
|
||||
return NULL;
|
||||
|
||||
val = g_slice_new0 (GValue);
|
||||
g_value_init (val, G_TYPE_UINT);
|
||||
g_value_set_uint (val, temp_addr.s_addr);
|
||||
|
||||
return val;
|
||||
return uint_to_gvalue (temp_addr.s_addr);
|
||||
}
|
||||
|
||||
static GValue *
|
||||
|
|
@ -263,6 +274,11 @@ main (int argc, char *argv[])
|
|||
if (val)
|
||||
g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_BANNER, val);
|
||||
|
||||
/* Set MTU to 1412 */
|
||||
val = uint_to_gvalue (1412);
|
||||
if (val)
|
||||
g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_MTU, val);
|
||||
|
||||
/* Send the config info to nm-vpnc-service */
|
||||
send_ip4_config (connection, config);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue