2006-08-24 Dan Williams <dcbw@redhat.com>

Patch from Ed Catmur:
	* src/NetworkManagerUtils.c
		- (nm_utils_ip4_netmask_to_prefix): don't infinitely loop
		if netmask is 0 (Gnome #352634)


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1987 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2006-08-24 11:01:37 +00:00
parent 8d7dd626ab
commit 1e28384c62
2 changed files with 9 additions and 0 deletions

View File

@@ -707,6 +707,8 @@ int nm_utils_ip4_netmask_to_prefix (guint32 ip4_netmask)
{
int i = 1;
g_return_val_if_fail (ip4_netmask != 0, 0);
/* Just count how many bit shifts we need */
ip4_netmask = ntohl (ip4_netmask);
while (!(ip4_netmask & 0x1) && ++i)