2008-10-02 Dan Williams <dcbw@redhat.com>

Patch from Alexander Sack <asac ubuntu com>

	* system-settings/plugins/ifupdown/parser.c
		- Implement more graceful ip4 config parsing for cases where
		  /etc/network/interfaces omits basic ip4 settings, such as gateway etc
		  by using default values



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4139 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-10-02 13:48:41 +00:00
parent 64f8dfa0af
commit 57ed51e2fe
2 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2008-10-02 Dan Williams <dcbw@redhat.com>
Patch from Alexander Sack <asac ubuntu com>
* system-settings/plugins/ifupdown/parser.c
- Implement more graceful ip4 config parsing for cases where
/etc/network/interfaces omits basic ip4 settings, such as gateway etc
by using default values
2008-10-02 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerPolicy.c

View file

@ -427,16 +427,26 @@ update_ip4_setting_from_if_block(NMConnection *connection,
if(nameserver_v)
nameservers_list_i = nameservers_list = g_slist_append(nameservers_list, g_strdup(nameserver_v));
if (!address_v)
address_v = g_strdup ("0.0.0.0");
if (inet_pton (AF_INET, address_v, &tmp_ip4_addr))
ip4config->address = tmp_ip4_addr.s_addr;
else
g_set_error (&error, eni_plugin_error_quark (), 0,
"Invalid %s IP4 address '%s'", "address", address_v);
if (!netmask_v)
netmask_v = g_strdup( "255.255.255.255");
if (inet_pton (AF_INET, netmask_v, &tmp_ip4_addr))
ip4config->prefix = nm_utils_ip4_netmask_to_prefix(tmp_ip4_addr.s_addr);
else
g_set_error (&error, eni_plugin_error_quark (), 0,
"Invalid %s IP4 address '%s'", "netmask", netmask_v);
if (!gateway_v)
gateway_v = g_strdup (address_v);
if (inet_pton (AF_INET, gateway_v, &tmp_ip4_addr))
ip4config->gateway = tmp_ip4_addr.s_addr;
else