about summary refs log tree commit diff
path: root/src/dhcp-manager/nm-dhcp-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dhcp-manager/nm-dhcp-utils.c')
-rw-r--r--src/dhcp-manager/nm-dhcp-utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dhcp-manager/nm-dhcp-utils.c b/src/dhcp-manager/nm-dhcp-utils.c
index be563a69..a88a7e6d 100644
--- a/src/dhcp-manager/nm-dhcp-utils.c
+++ b/src/dhcp-manager/nm-dhcp-utils.c
@@ -60,7 +60,7 @@ ip4_process_dhcpcd_rfc3442_routes (const char *str,
 			*slash = '\0';
 			errno = 0;
 			rt_cidr = strtol (slash + 1, NULL, 10);
-			if ((errno == EINVAL) || (errno == ERANGE)) {
+			if (errno || rt_cidr > 32) {
 				nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route cidr: '%s'", slash + 1);
 				continue;
 			}
@@ -382,7 +382,8 @@ nm_dhcp_utils_ip4_config_from_options (int ifindex,
 	in_addr_t addr;
 	NMPlatformIP4Address address;
 	char *str = NULL;
-	guint32 gwaddr = 0, plen = 0;
+	guint32 gwaddr = 0;
+	guint8 plen = 0;
 
 	g_return_val_if_fail (options != NULL, NULL);