mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 22:10:14 +01:00
2008-08-22 Dan Williams <dcbw@redhat.com>
* src/nm-openvpn-service-openvpn-helper.c - (main): grab tunnel MTU and push that through to NM git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4001 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
8779eef14c
commit
bce7a73c28
2 changed files with 35 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2008-08-22 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-openvpn-service-openvpn-helper.c
|
||||
- (main): grab tunnel MTU and push that through to NM
|
||||
|
||||
2008-08-18 Claude Paroz <claude@2xlibre.net>
|
||||
|
||||
* properties/nm-openvpn-dialog.glade: Removed translatable property on non
|
||||
|
|
|
|||
|
|
@ -126,6 +126,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)
|
||||
{
|
||||
|
|
@ -356,6 +371,21 @@ main (int argc, char *argv[])
|
|||
if (dns_domain)
|
||||
g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN, dns_domain);
|
||||
|
||||
/* Tunnel MTU */
|
||||
tmp = getenv ("tun_mtu");
|
||||
if (tmp && strlen (tmp)) {
|
||||
long int mtu;
|
||||
|
||||
errno = 0;
|
||||
mtu = strtol (tmp, NULL, 10);
|
||||
if (errno || mtu < 0 || mtu > 20000) {
|
||||
nm_warning ("Ignoring invalid tunnel MTU '%s'", tmp);
|
||||
} else {
|
||||
val = uint_to_gvalue ((guint32) mtu);
|
||||
g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_MTU, val);
|
||||
}
|
||||
}
|
||||
|
||||
/* Send the config info to nm-openvpn-service */
|
||||
send_ip4_config (connection, config);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue