summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorShane Kerr <shane@isc.org>2007-07-13 06:43:43 +0000
committerShane Kerr <shane@isc.org>2007-07-13 06:43:43 +0000
commit28868515f6cb8ec3a78773391945ac89d555d65d (patch)
tree108b4801b3d3d019278281eb276288271480afe3 /common
parent763cba6b918975315a644646137fec48e4953058 (diff)
downloadisc-dhcp-28868515f6cb8ec3a78773391945ac89d555d65d.tar.gz
Code cleanup to remove warnings from "gcc -Wall".
See RT ticket #16988 for more.
Diffstat (limited to 'common')
-rw-r--r--common/alloc.c15
-rw-r--r--common/bpf.c5
-rw-r--r--common/comapi.c31
-rw-r--r--common/conflex.c54
-rw-r--r--common/ctrace.c5
-rw-r--r--common/discover.c21
-rw-r--r--common/dispatch.c5
-rw-r--r--common/dlpi.c5
-rw-r--r--common/dns.c13
-rw-r--r--common/ethernet.c5
-rw-r--r--common/execute.c17
-rw-r--r--common/fddi.c5
-rw-r--r--common/icmp.c10
-rw-r--r--common/inet.c7
-rw-r--r--common/lpf.c10
-rw-r--r--common/memory.c9
-rw-r--r--common/nit.c5
-rw-r--r--common/options.c84
-rw-r--r--common/packet.c5
-rw-r--r--common/parse.c32
-rw-r--r--common/print.c11
-rw-r--r--common/raw.c5
-rw-r--r--common/resolv.c10
-rw-r--r--common/socket.c13
-rw-r--r--common/tables.c5
-rw-r--r--common/tr.c5
-rw-r--r--common/upf.c5
27 files changed, 90 insertions, 307 deletions
diff --git a/common/alloc.c b/common/alloc.c
index b89bd73b..9e18c6f6 100644
--- a/common/alloc.c
+++ b/common/alloc.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: alloc.c,v 1.60 2007/05/19 19:16:23 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
@@ -48,7 +43,6 @@ int option_chain_head_allocate (ptr, file, line)
const char *file;
int line;
{
- int size;
struct option_chain_head *h;
if (!ptr) {
@@ -109,7 +103,6 @@ int option_chain_head_dereference (ptr, file, line)
const char *file;
int line;
{
- int i;
struct option_chain_head *option_chain_head;
pair car, cdr;
@@ -161,7 +154,6 @@ int group_allocate (ptr, file, line)
const char *file;
int line;
{
- int size;
struct group *g;
if (!ptr) {
@@ -222,7 +214,6 @@ int group_dereference (ptr, file, line)
const char *file;
int line;
{
- int i;
struct group *group;
if (!ptr || !*ptr) {
@@ -744,8 +735,6 @@ int buffer_dereference (ptr, file, line)
const char *file;
int line;
{
- struct buffer *bp;
-
if (!ptr) {
log_error ("%s(%d): null pointer", file, line);
#if defined (POINTER_DEBUG)
@@ -833,8 +822,6 @@ int dns_host_entry_dereference (ptr, file, line)
const char *file;
int line;
{
- struct dns_host_entry *bp;
-
if (!ptr || !*ptr) {
log_error ("%s(%d): null pointer", file, line);
#if defined (POINTER_DEBUG)
@@ -1037,7 +1024,6 @@ int packet_allocate (ptr, file, line)
const char *file;
int line;
{
- int size;
struct packet *p;
if (!ptr) {
@@ -1157,7 +1143,6 @@ int dns_zone_allocate (ptr, file, line)
const char *file;
int line;
{
- int size;
struct dns_zone *d;
if (!ptr) {
diff --git a/common/bpf.c b/common/bpf.c
index 39a54152..d6f92a75 100644
--- a/common/bpf.c
+++ b/common/bpf.c
@@ -32,11 +32,6 @@
* managed to get me to integrate them.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: bpf.c,v 1.57 2007/05/19 23:39:51 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE) \
|| defined (USE_LPF_RECEIVE)
diff --git a/common/comapi.c b/common/comapi.c
index 4efae78f..b9dc9830 100644
--- a/common/comapi.c
+++ b/common/comapi.c
@@ -39,11 +39,6 @@
useful, you have Brian and BCtel to thank. Any limitations in the
code are a result of mistakes on my part. -- Ted Lemon */
-#ifndef lint
-static char copyright[] =
-"$Id: comapi.c,v 1.12 2006/02/24 23:16:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
@@ -143,7 +138,6 @@ isc_result_t dhcp_group_set_value (omapi_object_t *h,
{
struct group_object *group;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
@@ -217,7 +211,6 @@ isc_result_t dhcp_group_get_value (omapi_object_t *h, omapi_object_t *id,
{
struct group_object *group;
isc_result_t status;
- struct data_string ip_addrs;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
@@ -240,7 +233,6 @@ isc_result_t dhcp_group_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_group_destroy (omapi_object_t *h, const char *file, int line)
{
struct group_object *group, *t;
- isc_result_t status;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
@@ -271,7 +263,7 @@ isc_result_t dhcp_group_destroy (omapi_object_t *h, const char *file, int line)
isc_result_t dhcp_group_signal_handler (omapi_object_t *h,
const char *name, va_list ap)
{
- struct group_object *group, *t;
+ struct group_object *group;
isc_result_t status;
int updatep = 0;
@@ -453,7 +445,6 @@ isc_result_t dhcp_control_set_value (omapi_object_t *h,
{
dhcp_control_object_t *control;
isc_result_t status;
- int foo;
unsigned long newstate;
if (h -> type != dhcp_type_control)
@@ -488,7 +479,6 @@ isc_result_t dhcp_control_get_value (omapi_object_t *h, omapi_object_t *id,
{
dhcp_control_object_t *control;
isc_result_t status;
- struct data_string ip_addrs;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
@@ -511,9 +501,6 @@ isc_result_t dhcp_control_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_control_destroy (omapi_object_t *h,
const char *file, int line)
{
- dhcp_control_object_t *control, *t;
- isc_result_t status;
-
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
@@ -524,9 +511,8 @@ isc_result_t dhcp_control_destroy (omapi_object_t *h,
isc_result_t dhcp_control_signal_handler (omapi_object_t *h,
const char *name, va_list ap)
{
- dhcp_control_object_t *control, *t;
+ dhcp_control_object_t *control;
isc_result_t status;
- int updatep = 0;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
@@ -580,7 +566,6 @@ isc_result_t dhcp_control_lookup (omapi_object_t **lp,
{
omapi_value_t *tv = (omapi_value_t *)0;
isc_result_t status;
- dhcp_control_object_t *control;
/* First see if we were sent a handle. */
if (ref) {
@@ -629,7 +614,6 @@ isc_result_t dhcp_subnet_set_value (omapi_object_t *h,
{
struct subnet *subnet;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
@@ -675,7 +659,6 @@ isc_result_t dhcp_subnet_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t dhcp_subnet_destroy (omapi_object_t *h, const char *file, int line)
{
struct subnet *subnet;
- isc_result_t status;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
@@ -752,10 +735,6 @@ isc_result_t dhcp_subnet_lookup (omapi_object_t **lp,
omapi_object_t *id,
omapi_object_t *ref)
{
- omapi_value_t *tv = (omapi_value_t *)0;
- isc_result_t status;
- struct subnet *subnet;
-
/* Can't look up subnets yet. */
/* If we get to here without finding a subnet, no valid key was
@@ -784,7 +763,6 @@ isc_result_t dhcp_shared_network_set_value (omapi_object_t *h,
{
struct shared_network *shared_network;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
@@ -832,7 +810,6 @@ isc_result_t dhcp_shared_network_destroy (omapi_object_t *h,
const char *file, int line)
{
struct shared_network *shared_network;
- isc_result_t status;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
@@ -922,10 +899,6 @@ isc_result_t dhcp_shared_network_lookup (omapi_object_t **lp,
omapi_object_t *id,
omapi_object_t *ref)
{
- omapi_value_t *tv = (omapi_value_t *)0;
- isc_result_t status;
- struct shared_network *shared_network;
-
/* Can't look up shared_networks yet. */
/* If we get to here without finding a shared_network, no valid key was
diff --git a/common/conflex.c b/common/conflex.c
index 9756ec25..49747ab8 100644
--- a/common/conflex.c
+++ b/common/conflex.c
@@ -32,22 +32,16 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: conflex.c,v 1.112 2007/07/03 09:51:58 shane Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <ctype.h>
static int get_char PROTO ((struct parse *));
-static enum dhcp_token get_token PROTO ((struct parse *));
static void skip_to_eol PROTO ((struct parse *));
static enum dhcp_token read_whitespace(int c, struct parse *cfile);
static enum dhcp_token read_string PROTO ((struct parse *));
static enum dhcp_token read_number PROTO ((int, struct parse *));
static enum dhcp_token read_num_or_name PROTO ((int, struct parse *));
-static enum dhcp_token intern PROTO ((unsigned char *, enum dhcp_token));
+static enum dhcp_token intern PROTO ((char *, enum dhcp_token));
isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
struct parse **cfile;
@@ -214,7 +208,7 @@ static int get_char (cfile)
* when parsing IPv6 addresses).
*
* Generally we use the next_token() function to read tokens. This
- * in turn calls get_token, which does *not* return tokens for
+ * in turn calls get_next_token, which does *not* return tokens for
* whitespace. Rather, it skips these.
*
* When we need to see whitespace, we us next_raw_token(), which also
@@ -678,17 +672,15 @@ static enum dhcp_token read_num_or_name (c, cfile)
cfile -> tokbuf [i] = 0;
cfile -> tlen = i;
cfile -> tval = cfile -> tokbuf;
- return intern (cfile -> tval, rv);
+ return intern(cfile->tval, rv);
}
-static enum dhcp_token intern (atom, dfv)
- unsigned char *atom;
- enum dhcp_token dfv;
-{
- if (!isascii (atom [0]))
+static enum dhcp_token
+intern(char *atom, enum dhcp_token dfv) {
+ if (!isascii(atom[0]))
return dfv;
- switch (tolower (atom [0])) {
+ switch (tolower((unsigned char)atom[0])) {
case '-':
if (atom [1] == 0)
return MINUS;
@@ -861,7 +853,8 @@ static enum dhcp_token intern (atom, dfv)
}
break;
case 'e':
- if (isascii (atom [1]) && tolower (atom [1]) == 'x') {
+ if (isascii (atom [1]) &&
+ tolower((unsigned char)atom[1]) == 'x') {
if (!strcasecmp (atom + 2, "tract-int"))
return EXTRACT_INT;
if (!strcasecmp (atom + 2, "ists"))
@@ -1206,10 +1199,12 @@ static enum dhcp_token intern (atom, dfv)
case 's':
if (!strcasecmp(atom + 1, "cript"))
return SCRIPT;
- if (isascii(atom[1]) && tolower(atom[1]) == 'e') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'e') {
if (!strcasecmp(atom + 2, "arch"))
return SEARCH;
- if (isascii(atom[2]) && tolower(atom[2]) == 'c') {
+ if (isascii(atom[2]) &&
+ tolower((unsigned char)atom[2]) == 'c') {
if (!strncasecmp(atom + 3, "ond", 3)) {
if (!strcasecmp(atom + 6, "ary"))
return SECONDARY;
@@ -1256,14 +1251,16 @@ static enum dhcp_token intern (atom, dfv)
return TOKEN_SET;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 'h') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'h') {
if (!strcasecmp(atom + 2, "ared-network"))
return SHARED_NETWORK;
if (!strcasecmp(atom + 2, "utdown"))
return SHUTDOWN;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 'i') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'i') {
if (!strcasecmp(atom + 2, "addr"))
return SIADDR;
if (!strcasecmp(atom + 2, "gned"))
@@ -1272,8 +1269,10 @@ static enum dhcp_token intern (atom, dfv)
return SIZE;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 'p') {
- if (isascii(atom[2]) && tolower(atom[2]) == 'a') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'p') {
+ if (isascii(atom[2]) &&
+ tolower((unsigned char)atom[2]) == 'a') {
if (!strcasecmp(atom + 3, "ce"))
return SPACE;
if (!strcasecmp(atom + 3, "wn"))
@@ -1284,8 +1283,10 @@ static enum dhcp_token intern (atom, dfv)
return SPLIT;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 't') {
- if (isascii(atom[2]) && tolower(atom[2]) == 'a') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 't') {
+ if (isascii(atom[2]) &&
+ tolower((unsigned char)atom[2]) == 'a') {
if(!strncasecmp(atom + 3, "rt", 2)) {
if (!strcasecmp(atom + 5, "s"))
return STARTS;
@@ -1294,7 +1295,7 @@ static enum dhcp_token intern (atom, dfv)
break;
}
if (isascii(atom[3]) &&
- tolower(atom[3]) == 't') {
+ tolower((unsigned char)atom[3]) == 't') {
if (!strcasecmp(atom + 4, "e"))
return STATE;
if (!strcasecmp(atom + 4, "ic"))
@@ -1317,7 +1318,8 @@ static enum dhcp_token intern (atom, dfv)
return SUBSTRING;
break;
}
- if (isascii(atom[1]) && tolower(atom[1]) == 'u') {
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'u') {
if (!strcasecmp(atom + 2, "ffix"))
return SUFFIX;
if (!strcasecmp(atom + 2, "persede"))
diff --git a/common/ctrace.c b/common/ctrace.c
index 24476d10..fb39a79d 100644
--- a/common/ctrace.c
+++ b/common/ctrace.c
@@ -30,11 +30,6 @@
* learn more about Nominum, Inc., see ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: ctrace.c,v 1.8 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (TRACING)
diff --git a/common/discover.c b/common/discover.c
index feea4fa8..362280bb 100644
--- a/common/discover.c
+++ b/common/discover.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: discover.c,v 1.60 2007/06/08 14:58:20 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#define BSD_COMP /* needed on Solaris for SIOCGLIFNUM */
@@ -891,10 +886,13 @@ discover_interfaces(int state) {
struct iface_info info;
int err;
- struct interface_info *tmp, *ip;
+ struct interface_info *tmp;
struct interface_info *last, *next;
- char abuf[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
+#ifdef DHCPv6
+ char abuf[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
+#endif /* DHCPv6 */
+
struct subnet *subnet;
int ir;
@@ -903,8 +901,6 @@ discover_interfaces(int state) {
static int setup_fallback = 0;
- int sock;
-
if (!begin_iface_scan(&ifaces)) {
log_fatal("Can't get list of interfaces.");
}
@@ -1358,7 +1354,8 @@ got_one_v6(omapi_object_t *h) {
}
ip = (struct interface_info *)h;
- result = receive_packet6(ip, buf, sizeof(buf), &from, &to);
+ result = receive_packet6(ip, (unsigned char *)buf, sizeof(buf),
+ &from, &to);
if (result < 0) {
log_error("receive_packet6() failed on %s: %m", ip->name);
return ISC_R_UNEXPECTED;
@@ -1393,7 +1390,6 @@ isc_result_t dhcp_interface_set_value (omapi_object_t *h,
{
struct interface_info *interface;
isc_result_t status;
- int foo;
if (h -> type != dhcp_type_interface)
return ISC_R_INVALIDARG;
@@ -1436,7 +1432,6 @@ isc_result_t dhcp_interface_destroy (omapi_object_t *h,
const char *file, int line)
{
struct interface_info *interface;
- isc_result_t status;
if (h -> type != dhcp_type_interface)
return ISC_R_INVALIDARG;
@@ -1466,8 +1461,6 @@ isc_result_t dhcp_interface_signal_handler (omapi_object_t *h,
const char *name, va_list ap)
{
struct interface_info *ip, *interface;
- struct client_config *config;
- struct client_state *client;
isc_result_t status;
if (h -> type != dhcp_type_interface)
diff --git a/common/dispatch.c b/common/dispatch.c
index 60a05251..cc50f9f1 100644
--- a/common/dispatch.c
+++ b/common/dispatch.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: dispatch.c,v 1.66 2006/02/24 23:16:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
struct timeout *timeouts;
diff --git a/common/dlpi.c b/common/dlpi.c
index bf5418b6..c38255d1 100644
--- a/common/dlpi.c
+++ b/common/dlpi.c
@@ -85,11 +85,6 @@
* http://docs.hp.com/en/B2355-90139/index.html
*/
-#ifndef lint
-static char copyright[] =
-"$Id: dlpi.c,v 1.33 2007/05/19 18:47:14 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_DLPI_SEND) || defined (USE_DLPI_RECEIVE)
diff --git a/common/dns.c b/common/dns.c
index 8f89b004..adf3f55e 100644
--- a/common/dns.c
+++ b/common/dns.c
@@ -31,11 +31,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: dns.c,v 1.42 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include "arpa/nameser.h"
#include "dst/md5.h"
@@ -127,7 +122,6 @@ dns_zone_hash_t *dns_zone_hash;
isc_result_t find_tsig_key (ns_tsig_key **key, const char *zname,
struct dns_zone *zone)
{
- isc_result_t status;
ns_tsig_key *tkey;
if (!zone)
@@ -201,7 +195,6 @@ isc_result_t enter_dns_zone (struct dns_zone *zone)
isc_result_t dns_zone_lookup (struct dns_zone **zone, const char *name)
{
- struct dns_zone *tz = (struct dns_zone *)0;
int len;
char *tname = (char *)0;
isc_result_t status;
@@ -234,7 +227,6 @@ int dns_zone_dereference (ptr, file, line)
const char *file;
int line;
{
- int i;
struct dns_zone *dns_zone;
if (!ptr || !*ptr) {
@@ -397,9 +389,7 @@ void repudiate_zone (struct dns_zone **zone)
void cache_found_zone (ns_class class,
char *zname, struct in_addr *addrs, int naddrs)
{
- isc_result_t status = ISC_R_NOTFOUND;
struct dns_zone *zone = (struct dns_zone *)0;
- struct data_string nsaddrs;
int ix = strlen (zname);
if (zname [ix - 1] == '.')
@@ -684,7 +674,8 @@ ddns_update_fwd(struct data_string *ddns_fwd_name, struct iaddr ddns_addr,
/*
* Conflict detection override: delete DHCID RRs.
*/
- updrec = minires_mkupdrec(S_UPDATE, ddns_fwd_name->data,
+ updrec = minires_mkupdrec(S_UPDATE,
+ (const char *)ddns_fwd_name->data,
C_IN, T_DHCID, 0);
if (!updrec) {
diff --git a/common/ethernet.c b/common/ethernet.c
index c3542ef5..12d6d57f 100644
--- a/common/ethernet.c
+++ b/common/ethernet.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: ethernet.c,v 1.8 2005/03/17 20:14:58 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)
diff --git a/common/execute.c b/common/execute.c
index 92df944d..ac63b084 100644
--- a/common/execute.c
+++ b/common/execute.c
@@ -32,13 +32,10 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: execute.c,v 1.51 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <omapip/omapip_p.h>
+#include <sys/types.h>
+#include <sys/wait.h>
int execute_statements (result, packet, lease, client_state,
in_options, out_options, scope, statements)
@@ -54,8 +51,6 @@ int execute_statements (result, packet, lease, client_state,
struct executable_statement *r, *e, *next;
int rc;
int status;
- unsigned long num;
- struct binding_scope *outer;
struct binding *binding;
struct data_string ds;
struct binding_scope *ns;
@@ -363,7 +358,6 @@ int execute_statements (result, packet, lease, client_state,
binding -> next = (*scope) -> bindings;
(*scope) -> bindings = binding;
} else {
- badalloc:
dfree (binding, MDL);
binding = (struct binding *)0;
}
@@ -606,8 +600,6 @@ int executable_statement_dereference (ptr, file, line)
const char *file;
int line;
{
- struct executable_statement *bp;
-
if (!ptr || !*ptr) {
log_error ("%s(%d): null pointer", file, line);
#if defined (POINTER_DEBUG)
@@ -739,8 +731,6 @@ void write_statements (file, statements, indent)
{
struct executable_statement *r, *x;
struct expression *expr;
- int result;
- int status;
const char *s, *t, *dot;
int col;
@@ -1014,10 +1004,8 @@ int find_matching_case (struct executable_statement **ep,
{
int status, sub;
struct executable_statement *s;
- unsigned long foo;
if (is_data_expression (expr)) {
- struct executable_statement *e;
struct data_string cd, ds;
memset (&ds, 0, sizeof ds);
memset (&cd, 0, sizeof cd);
@@ -1091,7 +1079,6 @@ int executable_statement_foreach (struct executable_statement *stmt,
{
struct executable_statement *foo;
int ok = 0;
- int result;
for (foo = stmt; foo; foo = foo -> next) {
if ((*callback) (foo, vp, condp) != 0)
diff --git a/common/fddi.c b/common/fddi.c
index bb466fce..9d4446c8 100644
--- a/common/fddi.c
+++ b/common/fddi.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: fddi.c,v 1.4 2005/03/17 20:14:58 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (DEC_FDDI)
diff --git a/common/icmp.c b/common/icmp.c
index 79074542..fa34c40e 100644
--- a/common/icmp.c
+++ b/common/icmp.c
@@ -33,11 +33,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: icmp.c,v 1.34 2007/05/23 10:35:10 shane Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include "netinet/ip.h"
#include "netinet/ip_icmp.h"
@@ -61,11 +56,7 @@ void icmp_startup (routep, handler)
{
struct protoent *proto;
int protocol = 1;
- struct sockaddr_in from;
- int fd;
int state;
- struct icmp_state *new;
- omapi_object_t *h;
isc_result_t result;
/* Only initialize icmp once. */
@@ -284,7 +275,6 @@ isc_result_t icmp_echoreply (h)
void trace_icmp_input_input (trace_type_t *ttype, unsigned length, char *buf)
{
struct iaddr *ia;
- unsigned len;
u_int8_t *icbuf;
ia = (struct iaddr *)buf;
ia->len = ntohl(ia->len);
diff --git a/common/inet.c b/common/inet.c
index 4f8f1182..7bee0888 100644
--- a/common/inet.c
+++ b/common/inet.c
@@ -33,11 +33,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: inet.c,v 1.14 2007/06/19 17:06:03 shane Exp $ Copyright (c) 2004,2005,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
/* Return just the network number of an internet address... */
@@ -124,7 +119,7 @@ struct iaddr broadcast_addr (subnet, mask)
struct iaddr subnet;
struct iaddr mask;
{
- int i, j, k;
+ int i;
struct iaddr rv;
if (subnet.len > sizeof(subnet.iabuf))
diff --git a/common/lpf.c b/common/lpf.c
index 9255d16c..45ff5034 100644
--- a/common/lpf.c
+++ b/common/lpf.c
@@ -26,11 +26,6 @@
* http://www.isc.org/
*/
-#ifndef lint
-static char copyright[] =
-"$Id: lpf.c,v 1.35 2007/05/19 18:47:14 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE)
#include <sys/ioctl.h>
@@ -71,8 +66,6 @@ int if_register_lpf (info)
struct interface_info *info;
{
int sock;
- char filename[50];
- int b;
struct sockaddr sa;
/* Make an LPF socket. */
@@ -338,7 +331,6 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
struct sockaddr_in *from;
struct hardware *hfrom;
{
- int nread;
int length = 0;
int offset = 0;
unsigned char ibuf [1536];
@@ -460,7 +452,7 @@ get_hw_addr(const char *name, struct hardware *hw) {
break;
default:
log_fatal("Unsupported device type %ld for \"%s\"",
- sa->sa_family, name);
+ (long int)sa->sa_family, name);
}
close(sock);
diff --git a/common/memory.c b/common/memory.c
index 22a6c0cc..cd1de555 100644
--- a/common/memory.c
+++ b/common/memory.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: memory.c,v 1.69 2006/06/01 20:23:17 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
struct group *root_group;
@@ -84,8 +79,7 @@ isc_result_t delete_group (struct group_object *group, int writep)
isc_result_t supersede_group (struct group_object *group, int writep)
{
- struct group_object *t, *u;
- isc_result_t status;
+ struct group_object *t;
/* Register the group in the group name hash table,
so we can look it up later. */
@@ -142,7 +136,6 @@ isc_result_t supersede_group (struct group_object *group, int writep)
int clone_group (struct group **gp, struct group *group,
const char *file, int line)
{
- isc_result_t status;
struct group *g = (struct group *)0;
/* Normally gp should contain the null pointer, but for convenience
diff --git a/common/nit.c b/common/nit.c
index 26549412..ca36ee3a 100644
--- a/common/nit.c
+++ b/common/nit.c
@@ -33,11 +33,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: nit.c,v 1.36 2007/04/27 23:54:05 each Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_NIT_SEND) || defined (USE_NIT_RECEIVE)
#include <sys/ioctl.h>
diff --git a/common/options.c b/common/options.c
index c75c8b19..aa18fa65 100644
--- a/common/options.c
+++ b/common/options.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: options.c,v 1.110 2007/05/23 19:25:40 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#define DHCP_OPTION_DATA
#include "dhcpd.h"
#include <omapip/omapip_p.h>
@@ -44,9 +39,6 @@ static char copyright[] =
struct option *vendor_cfg_option;
-static void do_option_set PROTO ((pair *,
- struct option_cache *,
- enum statement_op));
static int pretty_text(char **, char *, const unsigned char **,
const unsigned char *, int);
static int pretty_domain(char **, char *, const unsigned char **,
@@ -57,7 +49,6 @@ static int pretty_domain(char **, char *, const unsigned char **,
int parse_options (packet)
struct packet *packet;
{
- int i;
struct option_cache *op = (struct option_cache *)0;
/* Allocate a new option state. */
@@ -137,8 +128,6 @@ int parse_option_buffer (options, buffer, length, universe)
unsigned length;
struct universe *universe;
{
- unsigned char *t;
- const unsigned char *end = buffer + length;
unsigned len, offset;
unsigned code;
struct option_cache *op = NULL, *nop = NULL;
@@ -356,7 +345,6 @@ int fqdn_universe_decode (struct option_state *options,
const unsigned char *buffer,
unsigned length, struct universe *u)
{
- char *name;
struct buffer *bp = (struct buffer *)0;
/* FQDN options have to be at least four bytes long. */
@@ -543,9 +531,7 @@ int cons_options (inpacket, outpacket, lease, client_state,
int priority_len;
unsigned char buffer [4096]; /* Really big buffer... */
unsigned main_buffer_size, mb_max;
- unsigned mainbufix, bufix, agentix;
- int fileix;
- int snameix;
+ unsigned mainbufix, agentix;
unsigned option_size;
unsigned length;
int i;
@@ -553,7 +539,6 @@ int cons_options (inpacket, outpacket, lease, client_state,
struct data_string ds;
pair pp, *hash;
int need_endopt = 0;
- int have_sso = 0;
int ocount = 0;
int ofbuf1=0, ofbuf2=0;
@@ -851,19 +836,23 @@ vsio_options(struct option_cache *oc,
if (universe->tag_size == 1) {
vs->buf[vs->bufpos++] = oc->option->code;
} else if (universe->tag_size == 2) {
- putUShort(vs->buf+vs->bufpos, oc->option->code);
+ putUShort((unsigned char *)vs->buf+vs->bufpos,
+ oc->option->code);
vs->bufpos += 2;
} else if (universe->tag_size == 4) {
- putULong(vs->buf+vs->bufpos, oc->option->code);
+ putULong((unsigned char *)vs->buf+vs->bufpos,
+ oc->option->code);
vs->bufpos += 4;
}
if (universe->length_size == 1) {
vs->buf[vs->bufpos++] = ds.len;
} else if (universe->length_size == 2) {
- putUShort(vs->buf+vs->bufpos, ds.len);
+ putUShort((unsigned char *)vs->buf+vs->bufpos,
+ ds.len);
vs->bufpos += 2;
} else if (universe->length_size == 4) {
- putULong(vs->buf+vs->bufpos, ds.len);
+ putULong((unsigned char *)vs->buf+vs->bufpos,
+ ds.len);
vs->bufpos += 4;
}
memcpy(vs->buf + vs->bufpos, ds.data, ds.len);
@@ -897,14 +886,13 @@ store_options6(char *buf, int buflen,
struct option *o;
struct data_string ds;
int bufpos;
- int len;
int oro_size;
u_int16_t code;
int in_required_opts;
- struct universe *u;
int vsio_option_code;
int vsio_wanted;
struct vsio_state vs;
+ unsigned char *tmp;
bufpos = 0;
vsio_wanted = 0;
@@ -942,12 +930,13 @@ store_options6(char *buf, int buflen,
NULL, opt_state, NULL,
&global_scope, oc, MDL)) {
if ((ds.len + 4) <= (buflen - bufpos)) {
+ tmp = (unsigned char *)buf + bufpos;
/* option tag */
- putUShort(buf+bufpos, required_opts[i]);
+ putUShort(tmp, required_opts[i]);
/* option length */
- putUShort(buf+bufpos+2, ds.len);
+ putUShort(tmp+2, ds.len);
/* option data */
- memcpy(buf+bufpos+4, ds.data, ds.len);
+ memcpy(tmp+4, ds.data, ds.len);
/* update position */
bufpos += (4 + ds.len);
} else {
@@ -1006,12 +995,13 @@ store_options6(char *buf, int buflen,
if (evaluate_option_cache(&ds, packet, NULL, NULL, opt_state,
NULL, &global_scope, oc, MDL)) {
if ((ds.len + 4) <= (buflen - bufpos)) {
+ tmp = (unsigned char *)buf + bufpos;
/* option tag */
- putUShort(buf+bufpos, code);
+ putUShort(tmp, code);
/* option length */
- putUShort(buf+bufpos+2, ds.len);
+ putUShort(tmp+2, ds.len);
/* option data */
- memcpy(buf+bufpos+4, ds.data, ds.len);
+ memcpy(tmp+4, ds.data, ds.len);
/* update position */
bufpos += (4 + ds.len);
} else {
@@ -1048,11 +1038,13 @@ store_options6(char *buf, int buflen,
* add the "header".
*/
if (vs.bufpos > bufpos+8) {
- putUShort(buf+bufpos,
+ tmp = (unsigned char *)buf +
+ bufpos;
+ putUShort(tmp,
vsio_option_code);
- putUShort(buf+bufpos+2,
+ putUShort(tmp+2,
vs.bufpos-bufpos-4);
- putULong(buf+bufpos+4, o->code);
+ putULong(tmp+4, o->code);
bufpos = vs.bufpos;
}
@@ -1175,7 +1167,6 @@ int store_options (ocount, buffer, buflen, packet, lease, client_state,
if ((option != NULL) &&
(((oc == NULL) && (option->format[0] == 'E')) ||
((oc != NULL) && (option->format[0] == 'e')))) {
- int uix;
static char *s, *t;
struct option_cache *tmp;
struct data_string name;
@@ -1314,7 +1305,6 @@ int store_options (ocount, buffer, buflen, packet, lease, client_state,
toptstart = tix;
while (length) {
unsigned incr = length;
- int consumed = 0;
int *pix;
unsigned char *base;
@@ -1430,7 +1420,6 @@ format_has_text(format)
const char *format;
{
const char *p;
- int retval = 0;
p = format;
while (*p != '\0') {
@@ -1987,7 +1976,7 @@ void set_option (universe, options, option, op)
case eval_statement:
case break_statement:
default:
- log_error ("bogus statement type in do_option_set.");
+ log_error ("bogus statement type in set_option.");
break;
case default_option_statement:
@@ -2240,7 +2229,7 @@ collect_oro(struct option_cache *oc,
void *void_oro) {
struct data_string *oro = (struct data_string *)void_oro;
- putUShort((char *)(oro->data + oro->len), oc->option->code);
+ putUShort((unsigned char *)(oro->data + oro->len), oc->option->code);
oro->len += 2;
}
@@ -2295,8 +2284,9 @@ build_server_oro(struct data_string *server_oro,
o = universes[i]->enc_opt;
while (o != NULL) {
if (o->universe == &dhcpv6_universe) {
- putUShort((char *)server_oro->data +
- server_oro->len,
+ unsigned char *tmp;
+ tmp = (unsigned char *)server_oro->data;
+ putUShort(tmp + server_oro->len,
o->code);
server_oro->len += 2;
break;
@@ -2395,7 +2385,6 @@ void delete_hashed_option (universe, options, code)
int hashix;
pair bptr, prev = (pair)0;
pair *hash = options -> universes [universe -> index];
- struct option_cache *oc;
/* There may not be any options in this space. */
if (!hash)
@@ -2642,12 +2631,11 @@ int option_space_encapsulate (result, packet, lease, client_state,
struct binding_scope **scope;
struct data_string *name;
{
- struct data_string sub;
- struct universe *u = NULL, *subu = NULL;
+ struct universe *u = NULL;
int status = 0;
- int i;
- universe_hash_lookup(&u, universe_hash, name->data, name->len, MDL);
+ universe_hash_lookup(&u, universe_hash,
+ (char *)name->data, name->len, MDL);
if (u == NULL) {
log_error("option_space_encapsulate: option space %.*s does "
"not exist, but is configured.",
@@ -2776,7 +2764,6 @@ int nwip_option_space_encapsulate (result, packet, lease, client_state,
{
pair ocp;
int status;
- int i;
static struct option_cache *no_nwip;
struct data_string ds;
struct option_chain_head *head;
@@ -2790,7 +2777,6 @@ int nwip_option_space_encapsulate (result, packet, lease, client_state,
status = 0;
for (ocp = head -> first; ocp; ocp = ocp -> cdr) {
- struct option_cache *oc = (struct option_cache *)(ocp -> car);
if (store_option (result, universe, packet,
lease, client_state, in_options,
cfg_options, scope,
@@ -3222,7 +3208,7 @@ fqdn6_universe_decode(struct option_state *options,
goto error;
/* Convert the domain name to textual representation for config. */
- len = MRns_name_ntop(buffer + 1, bp->data + 3, length - 1);
+ len = MRns_name_ntop(buffer + 1, (char *)bp->data + 3, length - 1);
if (len == -1) {
log_error("Unable to convert dhcp6.fqdn domain name to "
"printable form.");
@@ -3235,7 +3221,7 @@ fqdn6_universe_decode(struct option_state *options,
bp->data + 3, len, FQDN_FQDN, 1))
goto error;
- first_dot = strchr(bp->data + 3, '.');
+ first_dot = (unsigned char *)strchr((char *)bp->data + 3, '.');
if (first_dot != NULL) {
hlen = first_dot - bp->data + 3;
@@ -3302,8 +3288,6 @@ void suboption_foreach (struct packet *packet, struct lease *lease,
{
struct universe *universe = find_option_universe (oc -> option,
vsname);
- int i;
-
if (universe -> foreach)
(*universe -> foreach) (packet, lease, client_state,
in_options, cfg_options,
@@ -3352,7 +3336,6 @@ void save_linked_option (universe, options, oc)
struct option_cache *oc;
{
pair *tail;
- pair np = (pair )0;
struct option_chain_head *head;
struct option_cache **ocloc;
@@ -3527,7 +3510,6 @@ void do_packet (interface, packet, len, from_port, from, hfrom)
struct iaddr from;
struct hardware *hfrom;
{
- int i;
struct option_cache *op;
struct packet *decoded_packet;
#if defined (DEBUG_MEMORY_LEAKAGE)
diff --git a/common/packet.c b/common/packet.c
index e17933cd..3b2c1be9 100644
--- a/common/packet.c
+++ b/common/packet.c
@@ -31,11 +31,6 @@
* still be disabled.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: packet.c,v 1.48 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004,2005,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)
diff --git a/common/parse.c b/common/parse.c
index f418bb35..4d180c11 100644
--- a/common/parse.c
+++ b/common/parse.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: parse.c,v 1.129 2007/06/27 18:25:15 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <syslog.h>
@@ -335,9 +330,6 @@ int parse_ip_addr (cfile, addr)
struct parse *cfile;
struct iaddr *addr;
{
- const char *val;
- enum dhcp_token token;
-
addr -> len = 4;
if (parse_numeric_aggregate (cfile, addr -> iabuf,
&addr -> len, DOT, 10, 8))
@@ -732,7 +724,7 @@ void convert_num (cfile, buf, str, base, size)
int base;
unsigned size;
{
- const unsigned char *ptr = str;
+ const unsigned char *ptr = (const unsigned char *)str;
int negative = 0;
u_int32_t val = 0;
int tval;
@@ -860,7 +852,6 @@ void convert_num (cfile, buf, str, base, size)
TIME parse_date (cfile)
struct parse *cfile;
{
- struct tm tm;
int guess;
int tzoff, wday, year, mon, mday, hour, min, sec;
const char *val;
@@ -1428,7 +1419,6 @@ int parse_option_code_definition (cfile, option)
char tokbuf [128];
unsigned tokix = 0;
char type;
- int code;
int is_signed;
char *s;
int has_encapsulation = 0;
@@ -1953,7 +1943,6 @@ int parse_executable_statement (result, cfile, lose, case_context)
enum dhcp_token token;
const char *val;
unsigned len;
- struct executable_statement base;
struct class *cta;
struct option *option=NULL;
struct option_cache *cache;
@@ -2293,7 +2282,6 @@ int parse_executable_statement (result, cfile, lose, case_context)
if (token != NAME && token != NUMBER_OR_NAME) {
parse_warn (cfile,
"%s can't be a variable name", val);
- badunset:
skip_to_semi (cfile);
*lose = 1;
return 0;
@@ -3345,15 +3333,13 @@ int parse_non_binary (expr, cfile, lose, context)
enum dhcp_token token;
const char *val;
struct collection *col;
- struct option *option;
struct expression *nexp, **ep;
int known;
enum expr_op opcode;
const char *s;
char *cptr;
- int i;
unsigned long u;
- isc_result_t status, code;
+ isc_result_t status;
unsigned len;
token = peek_token (&val, (unsigned *)0, cfile);
@@ -3883,7 +3869,6 @@ int parse_non_binary (expr, cfile, lose, context)
parse_warn
(cfile,
"expecting dns expression.");
- badnstrans:
expression_dereference (expr, MDL);
*lose = 1;
return 0;
@@ -4917,7 +4902,6 @@ int parse_option_statement (result, cfile, lookups, option, op)
enum dhcp_token token;
struct expression *expr = (struct expression *)0;
int lose;
- int ftt = 1;
token = peek_token (&val, (unsigned *)0, cfile);
if (token == SEMI) {
@@ -4981,9 +4965,8 @@ int parse_option_token (rv, cfile, fmt, expr, uniform, lookups)
struct expression *t = (struct expression *)0;
unsigned char buf [4];
unsigned len;
- unsigned char *ob;
struct iaddr addr;
- int num, compress;
+ int compress;
const char *f, *g;
struct enumeration_value *e;
@@ -5253,11 +5236,6 @@ int parse_option_decl (oc, cfile)
/* Parse the option data... */
do {
- /* Set a flag if this is an array of a simple type (i.e.,
- not an array of pairs of IP addresses, or something
- like that. */
- int uniform = option -> format [1] == 'A';
-
for (fmt = option -> format; *fmt; fmt++) {
if (*fmt == 'A')
break;
@@ -5499,7 +5477,6 @@ int parse_X (cfile, buf, max)
int token;
const char *val;
unsigned len;
- u_int8_t *s;
token = peek_token (&val, (unsigned *)0, cfile);
if (token == NUMBER_OR_NAME || token == NUMBER) {
@@ -5566,8 +5543,7 @@ int parse_warn (struct parse *cfile, const char *fmt, ...)
if (lix < (sizeof lexbuf) - 1)
lexbuf [lix++] = ' ';
if (cfile -> token_line [i] == '\t') {
- for (lix;
- lix < (sizeof lexbuf) - 1 && (lix & 7); lix++)
+ for (; lix < (sizeof lexbuf) - 1 && (lix & 7); lix++)
lexbuf [lix] = ' ';
}
}
diff --git a/common/print.c b/common/print.c
index 51ce2d30..c7bad104 100644
--- a/common/print.c
+++ b/common/print.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: print.c,v 1.67 2007/06/07 15:52:29 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
int db_time_format = DEFAULT_TIME_FORMAT;
@@ -44,7 +39,7 @@ int db_time_format = DEFAULT_TIME_FORMAT;
char *quotify_string (const char *s, const char *file, int line)
{
unsigned len = 0;
- const unsigned char *sp;
+ const char *sp;
char *buf, *nsp;
for (sp = s; sp && *sp; sp++) {
@@ -461,7 +456,6 @@ static unsigned print_subexpression (expr, buf, len)
{
unsigned rv, left;
const char *s;
- struct expression *next_arg;
switch (expr -> op) {
case expr_none:
@@ -1091,7 +1085,6 @@ int token_print_indent_concat (FILE *file, int col, int indent,
const char *suffix, ...)
{
va_list list;
- char *buf;
unsigned len;
char *s, *t, *u;
@@ -1140,7 +1133,7 @@ int token_indent_data_string (FILE *file, int col, int indent,
/* If we have a purely ASCII string, output it as text. */
if (i == data -> len) {
- char *buf = dmalloc (data -> len + 3, MDL);
+ buf = dmalloc (data -> len + 3, MDL);
if (buf) {
buf [0] = '"';
memcpy (buf + 1, data -> data, data -> len);
diff --git a/common/raw.c b/common/raw.c
index 734c7000..55929abd 100644
--- a/common/raw.c
+++ b/common/raw.c
@@ -45,11 +45,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: raw.c,v 1.18 2005/03/17 20:15:00 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_RAW_SEND)
diff --git a/common/resolv.c b/common/resolv.c
index 5f34f78b..38396772 100644
--- a/common/resolv.c
+++ b/common/resolv.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: resolv.c,v 1.18 2006/02/24 23:16:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
struct name_server *name_servers;
@@ -50,10 +45,8 @@ void read_resolv_conf (parse_time)
struct parse *cfile;
const char *val;
int token;
- int declaration = 0;
struct name_server *sp, *sl, *ns;
struct domain_search_list *dp, *dl, *nd;
- struct iaddr *iaddr;
if ((file = open (path_resolv_conf, O_RDONLY)) < 0) {
log_error ("Can't open %s: %m", path_resolv_conf);
@@ -179,7 +172,6 @@ void read_resolv_conf (parse_time)
struct name_server *first_name_server ()
{
- FILE *rc;
static TIME rcdate;
struct stat st;
@@ -190,8 +182,6 @@ struct name_server *first_name_server ()
return (struct name_server *)0;
}
if (st.st_mtime > rcdate) {
- char rcbuf [512];
- char *s, *t, *u;
rcdate = cur_time + 1;
read_resolv_conf (rcdate);
diff --git a/common/socket.c b/common/socket.c
index 01a17b8c..ccd8ae08 100644
--- a/common/socket.c
+++ b/common/socket.c
@@ -40,12 +40,6 @@
* I have implemented it under Linux; other systems should be doable also.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: socket.c,v 1.66 2007/05/19 23:16:13 dhankins Exp $ "
-"Copyright (c) 2004-2007 Internet Systems Consortium.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#include <errno.h>
#include <sys/ioctl.h>
@@ -60,7 +54,14 @@ static char copyright[] =
# endif
#endif
+/*
+ * If we can't bind() to a specific interface, then we can only have
+ * a single socket. This variable insures that we don't try to listen
+ * on two sockets.
+ */
+#if !defined(SO_BINDTODEVICE) && !defined(USE_FALLBACK)
static int once = 0;
+#endif /* !defined(SO_BINDTODEVICE) && !defined(USE_FALLBACK) */
/* Reinitializes the specified interface after an address change. This
is not required for packet-filter APIs. */
diff --git a/common/tables.c b/common/tables.c
index 1228812d..6d8a5df9 100644
--- a/common/tables.c
+++ b/common/tables.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: tables.c,v 1.64 2007/05/29 18:11:55 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
/* XXXDPN: Moved here from hash.c, when it moved to libomapi. Not sure
diff --git a/common/tr.c b/common/tr.c
index da5eb416..2abf399f 100644
--- a/common/tr.c
+++ b/common/tr.c
@@ -26,11 +26,6 @@
* http://www.isc.org/
*/
-#ifndef lint
-static char copyright[] =
-"$Id: tr.c,v 1.11 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (HAVE_TR_SUPPORT) && \
diff --git a/common/upf.c b/common/upf.c
index fdb4e04e..9c66a758 100644
--- a/common/upf.c
+++ b/common/upf.c
@@ -32,11 +32,6 @@
* ``http://www.nominum.com''.
*/
-#ifndef lint
-static char copyright[] =
-"$Id: upf.c,v 1.24 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004,2007 Internet Systems Consortium. All rights reserved.\n";
-#endif /* not lint */
-
#include "dhcpd.h"
#if defined (USE_UPF_SEND) || defined (USE_UPF_RECEIVE)
#include <sys/ioctl.h>