summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd/dhcpd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
commit315054f4737a39489e0a14f3a92bff61f1592832 (patch)
tree62bf010653374ce09b6beb4dfa0414a91457233b /usr.sbin/dhcpd/dhcpd.c
parent79e3d817585ca08a91e30ad14abe43e2ab70295f (diff)
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'usr.sbin/dhcpd/dhcpd.c')
-rw-r--r--usr.sbin/dhcpd/dhcpd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/dhcpd/dhcpd.c b/usr.sbin/dhcpd/dhcpd.c
index 8c854bbf9dd..38bd308ddc0 100644
--- a/usr.sbin/dhcpd/dhcpd.c
+++ b/usr.sbin/dhcpd/dhcpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpd.c,v 1.45 2014/07/11 09:42:27 yasuoka Exp $ */
+/* $OpenBSD: dhcpd.c,v 1.46 2015/01/16 06:40:16 deraadt Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org>
@@ -320,6 +320,8 @@ lease_ping_timeout(void *vlp)
/* from memory.c - needed to be able to walk the lease table */
extern struct subnet *subnets;
+#define MINIMUM(a,b) (((a)<(b))?(a):(b))
+
void
periodic_scan(void *p)
{
@@ -330,10 +332,10 @@ periodic_scan(void *p)
struct lease *l;
/* find the shortest lease this server gives out */
- x = MIN(root_group.default_lease_time, root_group.max_lease_time);
+ x = MINIMUM(root_group.default_lease_time, root_group.max_lease_time);
for (n = subnets; n; n = n->next_subnet)
for (g = n->group; g; g = g->next)
- x = MIN(x, g->default_lease_time);
+ x = MINIMUM(x, g->default_lease_time);
/* use half of the shortest lease as the scan interval */
y = x / 2;