diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/dhcpd/bootp.c | 4 | ||||
-rw-r--r-- | usr.sbin/dhcpd/confpars.c | 20 | ||||
-rw-r--r-- | usr.sbin/dhcpd/dhcp.c | 26 | ||||
-rw-r--r-- | usr.sbin/dhcpd/tree.c | 33 |
4 files changed, 18 insertions, 65 deletions
diff --git a/usr.sbin/dhcpd/bootp.c b/usr.sbin/dhcpd/bootp.c index 037f1f4973e..e022b142dbf 100644 --- a/usr.sbin/dhcpd/bootp.c +++ b/usr.sbin/dhcpd/bootp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bootp.c,v 1.12 2005/01/31 21:23:08 claudio Exp $ */ +/* $OpenBSD: bootp.c,v 1.13 2006/03/13 19:57:42 otto Exp $ */ /* * BOOTP Protocol support. @@ -254,7 +254,7 @@ lose: netmask_tree.value = lease->subnet->netmask.iabuf; netmask_tree.len = lease->subnet->netmask.len; netmask_tree.buf_size = lease->subnet->netmask.len; - netmask_tree.timeout = 0xFFFFFFFF; + netmask_tree.timeout = -1; netmask_tree.tree = NULL; } diff --git a/usr.sbin/dhcpd/confpars.c b/usr.sbin/dhcpd/confpars.c index f66dda6c72b..ccd28843740 100644 --- a/usr.sbin/dhcpd/confpars.c +++ b/usr.sbin/dhcpd/confpars.c @@ -1,4 +1,4 @@ -/* $OpenBSD: confpars.c,v 1.12 2004/09/16 18:35:42 deraadt Exp $ */ +/* $OpenBSD: confpars.c,v 1.13 2006/03/13 19:57:42 otto Exp $ */ /* * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. @@ -560,8 +560,7 @@ void parse_host_declaration(cfile, group) (unsigned char *)name; host->group->options[DHO_HOST_NAME]->buf_size = host->group->options[DHO_HOST_NAME]->len; - host->group->options[DHO_HOST_NAME]->timeout = - 0xFFFFFFFF; + host->group->options[DHO_HOST_NAME]->timeout = -1; host->group->options[DHO_HOST_NAME]->tree = NULL; } @@ -1115,21 +1114,6 @@ void parse_option_param(cfile, group) group->options[option->code] = tree_cache(tree); } -/* timestamp :== date - - Timestamps are actually not used in dhcpd.conf, which is a static file, - but rather in the database file and the journal file. (Okay, actually - they're not even used there yet). */ - -time_t -parse_timestamp(FILE *cfile) -{ - time_t rv; - - rv = parse_date(cfile); - return rv; -} - /* lease_declaration :== LEASE ip_address LBRACE lease_parameters RBRACE lease_parameters :== <nil> diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c index 0b0bbddc9f7..b0f0373aeac 100644 --- a/usr.sbin/dhcpd/dhcp.c +++ b/usr.sbin/dhcpd/dhcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcp.c,v 1.20 2005/11/22 21:33:56 beck Exp $ */ +/* $OpenBSD: dhcp.c,v 1.21 2006/03/13 19:57:42 otto Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 @@ -509,7 +509,7 @@ nak_lease(struct packet *packet, struct iaddr *cip) options[DHO_DHCP_MESSAGE_TYPE]->value = &nak; options[DHO_DHCP_MESSAGE_TYPE]->len = sizeof nak; options[DHO_DHCP_MESSAGE_TYPE]->buf_size = sizeof nak; - options[DHO_DHCP_MESSAGE_TYPE]->timeout = 0xFFFFFFFF; + options[DHO_DHCP_MESSAGE_TYPE]->timeout = -1; options[DHO_DHCP_MESSAGE_TYPE]->tree = NULL; /* Set DHCP_MESSAGE to whatever the message is */ @@ -517,7 +517,7 @@ nak_lease(struct packet *packet, struct iaddr *cip) options[DHO_DHCP_MESSAGE]->value = (unsigned char *)dhcp_message; options[DHO_DHCP_MESSAGE]->len = strlen(dhcp_message); options[DHO_DHCP_MESSAGE]->buf_size = strlen(dhcp_message); - options[DHO_DHCP_MESSAGE]->timeout = 0xFFFFFFFF; + options[DHO_DHCP_MESSAGE]->timeout = -1; options[DHO_DHCP_MESSAGE]->tree = NULL; /* Do not use the client's requested parameter list. */ @@ -915,7 +915,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, state->options[i]->value = (unsigned char *)lease->hostname; state->options[i]->len = strlen (lease->hostname); state->options[i]->buf_size = state->options[i]->len; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; } @@ -930,7 +930,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, state->options[i]->value = &state->offer; state->options[i]->len = sizeof state->offer; state->options[i]->buf_size = sizeof state->offer; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; i = DHO_DHCP_SERVER_IDENTIFIER; @@ -943,7 +943,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, sizeof state->ip->primary_address; state->options[i]->buf_size = state->options[i]->len; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; state->from.len = sizeof state->ip->primary_address; memcpy(state->from.iabuf, &state->ip->primary_address, @@ -978,7 +978,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, state->options[i]->value = (unsigned char *)&state->expiry; state->options[i]->len = sizeof state->expiry; state->options[i]->buf_size = sizeof state->expiry; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; /* Renewal time is lease time * 0.5. */ @@ -992,7 +992,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, (unsigned char *)&state->renewal; state->options[i]->len = sizeof state->renewal; state->options[i]->buf_size = sizeof state->renewal; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; @@ -1008,7 +1008,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, (unsigned char *)&state->rebind; state->options[i]->len = sizeof state->rebind; state->options[i]->buf_size = sizeof state->rebind; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; /* If we used the vendor class the client specified, we @@ -1024,7 +1024,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, strlen (vendor_class->name); state->options[i]->buf_size = state->options[i]->len; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; } @@ -1040,7 +1040,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, strlen (user_class->name); state->options[i]->buf_size = state->options[i]->len; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; } } @@ -1056,7 +1056,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, state->options[i]->len = lease->subnet->netmask.len; state->options[i]->buf_size = lease->subnet->netmask.len; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; } @@ -1086,7 +1086,7 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, state->options[i]->value = lease->ip_addr.iabuf; state->options[i]->len = lease->ip_addr.len; state->options[i]->buf_size = lease->ip_addr.len; - state->options[i]->timeout = 0xFFFFFFFF; + state->options[i]->timeout = -1; state->options[i]->tree = NULL; } diff --git a/usr.sbin/dhcpd/tree.c b/usr.sbin/dhcpd/tree.c index 138f767062a..de9ba81b73e 100644 --- a/usr.sbin/dhcpd/tree.c +++ b/usr.sbin/dhcpd/tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.c,v 1.10 2004/09/16 18:35:43 deraadt Exp $ */ +/* $OpenBSD: tree.c,v 1.11 2006/03/13 19:57:42 otto Exp $ */ /* Routines for manipulating parse trees... */ @@ -73,37 +73,6 @@ tree_cache(struct tree *tree) } struct tree * -tree_host_lookup(char *name) -{ - struct tree *nt; - - nt = new_tree("tree_host_lookup"); - if (!nt) - error("No memory for host lookup tree node."); - nt->op = TREE_HOST_LOOKUP; - nt->data.host_lookup.host = enter_dns_host(name); - return nt; -} - -struct dns_host_entry * -enter_dns_host(char *name) -{ - struct dns_host_entry *dh; - int len = strlen(name) + 1; - - if (!(dh = (struct dns_host_entry *)dmalloc - (sizeof(struct dns_host_entry), "enter_dns_host")) || - !(dh->hostname = dmalloc(len, "enter_dns_host"))) - error("Can't allocate space for new host."); - strlcpy(dh->hostname, name, len); - dh->data = NULL; - dh->data_len = 0; - dh->buf_len = 0; - dh->timeout = 0; - return dh; -} - -struct tree * tree_const(unsigned char *data, int len) { struct tree *nt; |