summaryrefslogtreecommitdiff
path: root/src/dnsmasq-manager
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-01-31 19:49:52 +0100
committerDan Winship <danw@gnome.org>2014-01-31 19:49:52 +0100
commit07edeabbc34d3c98089ec4299e457325dc78856b (patch)
tree1690a2af75fedfb5a964b53c80b465d53bbfd3dd /src/dnsmasq-manager
parent6c2f96421b1c7bfd65032bf4de2a6cfc10b3b262 (diff)
downloadNetworkManager-07edeabbc34d3c98089ec4299e457325dc78856b.tar.gz
trivial: fix a coverity warning
"reserved" is unsigned, so CLAMP(reserved, 0, 8) does an unnecessary check.
Diffstat (limited to 'src/dnsmasq-manager')
-rw-r--r--src/dnsmasq-manager/nm-dnsmasq-utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dnsmasq-manager/nm-dnsmasq-utils.c b/src/dnsmasq-manager/nm-dnsmasq-utils.c
index 538a9e5266..7036b40932 100644
--- a/src/dnsmasq-manager/nm-dnsmasq-utils.c
+++ b/src/dnsmasq-manager/nm-dnsmasq-utils.c
@@ -62,11 +62,11 @@ nm_dnsmasq_utils_get_range (const NMPlatformIP4Address *addr,
if (ntohl (host) - ntohl (first) > ntohl (last) - ntohl (host)) {
/* Range below the host's IP address */
reserved = (guint32) ((ntohl (host) - ntohl (first)) / 10);
- last = host - htonl (CLAMP (reserved, 0, 8)) - htonl (1);
+ last = host - htonl (MIN (reserved, 8)) - htonl (1);
} else {
/* Range above host's IP address */
reserved = (guint32) ((ntohl (last) - ntohl (host)) / 10);
- first = host + htonl (CLAMP (reserved, 0, 8)) + htonl (1);
+ first = host + htonl (MIN (reserved, 8)) + htonl (1);
}
nm_utils_inet4_ntop (first, out_first);