summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-03-16 15:44:41 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-03-16 15:44:41 +0000
commitc8a1e8969d40b002b8ef499ca0b7d42e83a16538 (patch)
tree70493f9948fa5a202e5833a25bea4b5083a07219 /usr.sbin
parent815a6c67e54ec9208e17f5d5b4739e2a2f299c23 (diff)
KNF. No binary change.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/dhcpd/dhcp.c46
-rw-r--r--usr.sbin/dhcpd/dispatch.c4
2 files changed, 25 insertions, 25 deletions
diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c
index b0f0373aeac..47a219df000 100644
--- a/usr.sbin/dhcpd/dhcp.c
+++ b/usr.sbin/dhcpd/dhcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcp.c,v 1.21 2006/03/13 19:57:42 otto Exp $ */
+/* $OpenBSD: dhcp.c,v 1.22 2006/03/16 15:44:40 claudio Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
@@ -651,7 +651,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
/* Replace the old lease hostname with the new one, if it's changed. */
if (packet->options[DHO_HOST_NAME].len &&
lease->client_hostname &&
- (strlen (lease->client_hostname) == packet->options[DHO_HOST_NAME].len) &&
+ (strlen(lease->client_hostname) == packet->options[DHO_HOST_NAME].len) &&
!memcmp(lease->client_hostname, packet->options[DHO_HOST_NAME].data,
packet->options[DHO_HOST_NAME].len)) {
} else if (packet->options[DHO_HOST_NAME].len) {
@@ -887,7 +887,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
was sent. */
i = DHO_DHCP_MAX_MESSAGE_SIZE;
if (packet->options[i].data &&
- packet->options[i].len == sizeof (u_int16_t))
+ packet->options[i].len == sizeof(u_int16_t))
state->max_message_size = getUShort(packet->options[i].data);
/* Otherwise, if a maximum message size was specified, use that. */
else if (state->options[i] && state->options[i]->value)
@@ -913,7 +913,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
state->options[i] = new_tree_cache("hostname");
state->options[i]->flags = TC_TEMPORARY;
state->options[i]->value = (unsigned char *)lease->hostname;
- state->options[i]->len = strlen (lease->hostname);
+ state->options[i]->len = strlen(lease->hostname);
state->options[i]->buf_size = state->options[i]->len;
state->options[i]->timeout = -1;
state->options[i]->tree = NULL;
@@ -950,7 +950,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
state->from.len);
} else {
/* Find the value of the server identifier... */
- if (!tree_evaluate (state->options[i]))
+ if (!tree_evaluate(state->options[i]))
goto use_primary;
if (!state->options[i]->value ||
(state->options[i]->len > sizeof state->from.iabuf))
@@ -973,7 +973,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
putULong((unsigned char *)&state->expiry,
offered_lease_time);
i = DHO_DHCP_LEASE_TIME;
- state->options[i] = new_tree_cache ("lease-expiry");
+ state->options[i] = new_tree_cache("lease-expiry");
state->options[i]->flags = TC_TEMPORARY;
state->options[i]->value = (unsigned char *)&state->expiry;
state->options[i]->len = sizeof state->expiry;
@@ -983,10 +983,10 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
/* Renewal time is lease time * 0.5. */
offered_lease_time /= 2;
- putULong ((unsigned char *)&state->renewal,
+ putULong((unsigned char *)&state->renewal,
offered_lease_time);
i = DHO_DHCP_RENEWAL_TIME;
- state->options[i] = new_tree_cache ("renewal-time");
+ state->options[i] = new_tree_cache("renewal-time");
state->options[i]->flags = TC_TEMPORARY;
state->options[i]->value =
(unsigned char *)&state->renewal;
@@ -999,10 +999,10 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
/* Rebinding time is lease time * 0.875. */
offered_lease_time += (offered_lease_time / 2 +
offered_lease_time / 4);
- putULong ((unsigned char *)&state->rebind,
+ putULong((unsigned char *)&state->rebind,
offered_lease_time);
i = DHO_DHCP_REBINDING_TIME;
- state->options[i] = new_tree_cache ("rebind-time");
+ state->options[i] = new_tree_cache("rebind-time");
state->options[i]->flags = TC_TEMPORARY;
state->options[i]->value =
(unsigned char *)&state->rebind;
@@ -1016,12 +1016,12 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
if (vendor_class) {
i = DHO_DHCP_CLASS_IDENTIFIER;
state->options[i] =
- new_tree_cache ("class-identifier");
+ new_tree_cache("class-identifier");
state->options[i]->flags = TC_TEMPORARY;
state->options[i]->value =
(unsigned char *)vendor_class->name;
state->options[i]->len =
- strlen (vendor_class->name);
+ strlen(vendor_class->name);
state->options[i]->buf_size =
state->options[i]->len;
state->options[i]->timeout = -1;
@@ -1032,12 +1032,12 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
have to return it. */
if (user_class) {
i = DHO_DHCP_USER_CLASS_ID;
- state->options[i] = new_tree_cache ("user-class");
+ state->options[i] = new_tree_cache("user-class");
state->options[i]->flags = TC_TEMPORARY;
state->options[i]->value =
(unsigned char *)user_class->name;
state->options[i]->len =
- strlen (user_class->name);
+ strlen(user_class->name);
state->options[i]->buf_size =
state->options[i]->len;
state->options[i]->timeout = -1;
@@ -1049,7 +1049,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
mask has been provided. */
i = DHO_SUBNET_MASK;
if (!state->options[i]) {
- state->options[i] = new_tree_cache ("subnet-mask");
+ state->options[i] = new_tree_cache("subnet-mask");
state->options[i]->flags = TC_TEMPORARY;
state->options[i]->value =
lease->subnet->netmask.iabuf;
@@ -1081,7 +1081,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
i = DHO_ROUTERS;
if (ulafdr && !state->options[i]) {
- state->options[i] = new_tree_cache ("routers");
+ state->options[i] = new_tree_cache("routers");
state->options[i]->flags = TC_TEMPORARY;
state->options[i]->value = lease->ip_addr.iabuf;
state->options[i]->len = lease->ip_addr.len;
@@ -1097,12 +1097,12 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
if (offer == DHCPOFFER && !(lease->flags & STATIC_LEASE) &&
cur_time - lease->timestamp > 60) {
lease->timestamp = cur_time;
- icmp_echorequest (&lease->ip_addr);
- add_timeout (cur_time + 1, lease_ping_timeout, lease);
+ icmp_echorequest(&lease->ip_addr);
+ add_timeout(cur_time + 1, lease_ping_timeout, lease);
++outstanding_pings;
} else {
lease->timestamp = cur_time;
- dhcp_reply (lease);
+ dhcp_reply(lease);
}
}
@@ -1258,7 +1258,7 @@ dhcp_reply(struct lease *lease)
and is not requesting a broadcast response, and we can
unicast to a client without using the ARP protocol, sent it
directly to that client. */
- } else if (!(raw.flags & htons (BOOTP_BROADCAST))) {
+ } else if (!(raw.flags & htons(BOOTP_BROADCAST))) {
to.sin_addr = raw.yiaddr;
to.sin_port = client_port;
@@ -1338,7 +1338,7 @@ find_lease(struct packet *packet, struct shared_network *share,
packet->raw->chaddr, packet->raw->hlen);
if (hp) {
host = hp; /* Save it for later. */
- fixed_lease = mockup_lease (packet, share, hp);
+ fixed_lease = mockup_lease(packet, share, hp);
}
}
@@ -1351,7 +1351,7 @@ find_lease(struct packet *packet, struct shared_network *share,
if (ours)
*ours = 1;
strlcpy(dhcp_message, "requested address is incorrect",
- sizeof (dhcp_message));
+ sizeof(dhcp_message));
return NULL;
}
@@ -1423,7 +1423,7 @@ find_lease(struct packet *packet, struct shared_network *share,
ip_lease->shared_network->name);
if (uid_lease && !packet->raw->ciaddr.s_addr)
- release_lease (uid_lease);
+ release_lease(uid_lease);
}
uid_lease = ip_lease;
}
diff --git a/usr.sbin/dhcpd/dispatch.c b/usr.sbin/dhcpd/dispatch.c
index 152540093cb..19f47995b99 100644
--- a/usr.sbin/dhcpd/dispatch.c
+++ b/usr.sbin/dhcpd/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.16 2005/01/31 18:27:38 millert Exp $ */
+/* $OpenBSD: dispatch.c,v 1.17 2006/03/16 15:44:40 claudio Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
@@ -378,7 +378,7 @@ got_one(struct protocol *l)
} u;
struct interface_info *ip = l->local;
- if ((result = receive_packet (ip, u.packbuf, sizeof u,
+ if ((result = receive_packet(ip, u.packbuf, sizeof u,
&from, &hfrom)) == -1) {
warning("receive_packet failed on %s: %s", ip->name,
strerror(errno));