summaryrefslogtreecommitdiff
path: root/usr.sbin/bootp
diff options
context:
space:
mode:
authorxtraeme <xtraeme@NetBSD.org>2008-05-02 19:22:10 +0000
committerxtraeme <xtraeme@NetBSD.org>2008-05-02 19:22:10 +0000
commitc8f61d2b509f78f0f05810afbf0d6e317b3b8fa4 (patch)
treed6dce4110ce03b4573171a33eb093219fc7808cd /usr.sbin/bootp
parente20ddcfff5fdb88a5c97400f1e9faf60ff25bc6b (diff)
WARNS=4
Diffstat (limited to 'usr.sbin/bootp')
-rw-r--r--usr.sbin/bootp/bootpd/bootpd.c44
-rw-r--r--usr.sbin/bootp/bootpef/bootpef.c6
-rw-r--r--usr.sbin/bootp/bootptest/bootptest.c6
-rw-r--r--usr.sbin/bootp/bootptest/print-bootp.c6
-rw-r--r--usr.sbin/bootp/common/bootpd.h6
-rw-r--r--usr.sbin/bootp/common/dumptab.c10
-rw-r--r--usr.sbin/bootp/common/hwaddr.h4
-rw-r--r--usr.sbin/bootp/common/readfile.c16
-rw-r--r--usr.sbin/bootp/common/report.c6
9 files changed, 52 insertions, 52 deletions
diff --git a/usr.sbin/bootp/bootpd/bootpd.c b/usr.sbin/bootp/bootpd/bootpd.c
index edf0de0198b..78542142954 100644
--- a/usr.sbin/bootp/bootpd/bootpd.c
+++ b/usr.sbin/bootp/bootpd/bootpd.c
@@ -22,7 +22,7 @@ SOFTWARE.
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: bootpd.c,v 1.21 2007/05/27 16:31:41 tls Exp $");
+__RCSID("$NetBSD: bootpd.c,v 1.22 2008/05/02 19:22:10 xtraeme Exp $");
#endif
/*
@@ -103,7 +103,7 @@ __RCSID("$NetBSD: bootpd.c,v 1.21 2007/05/27 16:31:41 tls Exp $");
* Externals, forward declarations, and global variables
*/
-extern void dumptab(char *);
+extern void dumptab(const char *);
PRIVATE void catcher(int);
PRIVATE int chk_access(char *, int32 *);
@@ -146,7 +146,7 @@ int actualtimeout = 15 * 60000; /* fifteen minutes */
int s; /* Socket file descriptor */
char *pktbuf; /* Receive packet buffer */
int pktlen;
-char *progname;
+const char *progname;
char *chdir_path;
char hostname[MAXHOSTNAMELEN + 1]; /* System host name */
struct in_addr my_ip_addr;
@@ -159,8 +159,8 @@ PRIVATE int do_dumptab = 0;
* Globals below are associated with the bootp database file (bootptab).
*/
-char *bootptab = CONFIG_FILE;
-char *bootpd_dump = DUMPTAB_FILE;
+const char *bootptab = CONFIG_FILE;
+const char *bootpd_dump = DUMPTAB_FILE;
@@ -597,7 +597,7 @@ handle_request(void)
int32 bootsize = 0;
unsigned hlen, hashcode;
int32 dest;
- char realpath[1024];
+ char lrealpath[1024];
char *clntpath;
char *homedir, *bootfile;
int n;
@@ -809,11 +809,11 @@ HW addr type is IEEE 802. convert to %s and check again\n",
* daemon chroot directory (i.e. /tftpboot).
*/
if (hp->flags.tftpdir) {
- strlcpy(realpath, hp->tftpdir->string, sizeof(realpath));
- clntpath = &realpath[strlen(realpath)];
+ strlcpy(lrealpath, hp->tftpdir->string, sizeof(lrealpath));
+ clntpath = &lrealpath[strlen(lrealpath)];
} else {
- realpath[0] = '\0';
- clntpath = realpath;
+ lrealpath[0] = '\0';
+ clntpath = lrealpath;
}
/*
@@ -865,17 +865,17 @@ HW addr type is IEEE 802. convert to %s and check again\n",
*/
if (homedir) {
if (homedir[0] != '/')
- strlcat(realpath, "/", sizeof(realpath));
- strlcat(realpath, homedir, sizeof(realpath));
+ strlcat(lrealpath, "/", sizeof(lrealpath));
+ strlcat(lrealpath, homedir, sizeof(lrealpath));
homedir = NULL;
}
if (bootfile) {
if (bootfile[0] != '/') {
- strlcat(realpath, "/", sizeof(realpath));
- realpath[sizeof(realpath) - 1] = '\0';
+ strlcat(lrealpath, "/", sizeof(lrealpath));
+ lrealpath[sizeof(lrealpath) - 1] = '\0';
}
- strlcat(realpath, bootfile, sizeof(realpath));
- realpath[sizeof(realpath) - 1] = '\0';
+ strlcat(lrealpath, bootfile, sizeof(lrealpath));
+ lrealpath[sizeof(lrealpath) - 1] = '\0';
bootfile = NULL;
}
@@ -885,9 +885,9 @@ HW addr type is IEEE 802. convert to %s and check again\n",
n = strlen(clntpath);
strlcat(clntpath, ".", sizeof(clntpath));
strlcat(clntpath, hp->hostname->string, sizeof(clntpath));
- if (chk_access(realpath, &bootsize) < 0) {
+ if (chk_access(lrealpath, &bootsize) < 0) {
clntpath[n] = 0; /* Try it without the suffix */
- if (chk_access(realpath, &bootsize) < 0) {
+ if (chk_access(lrealpath, &bootsize) < 0) {
/* neither "file.host" nor "file" was found */
#ifdef CHECK_FILE_ACCESS
@@ -1237,7 +1237,7 @@ dovend_rfc1048(struct bootp *bp, struct host *hp, int32 bootsize)
*/
{
byte *p, *ep;
- byte tag, len;
+ byte tag, llen;
short msgsz = 0;
p = vp + 4;
@@ -1250,10 +1250,10 @@ dovend_rfc1048(struct bootp *bp, struct host *hp, int32 bootsize)
if (tag == TAG_END)
break;
/* Now scan the length byte. */
- len = *p++;
+ llen = *p++;
switch (tag) {
case TAG_MAX_MSGSZ:
- if (len == 2) {
+ if (llen == 2) {
bcopy(p, (char*)&msgsz, 2);
msgsz = ntohs(msgsz);
}
@@ -1262,7 +1262,7 @@ dovend_rfc1048(struct bootp *bp, struct host *hp, int32 bootsize)
/* XXX - Should preserve this if given... */
break;
} /* swtich */
- p += len;
+ p += llen;
}
if (msgsz > sizeof(*bp)) {
diff --git a/usr.sbin/bootp/bootpef/bootpef.c b/usr.sbin/bootp/bootpef/bootpef.c
index be68ec2a772..d14fa37ae73 100644
--- a/usr.sbin/bootp/bootpef/bootpef.c
+++ b/usr.sbin/bootp/bootpef/bootpef.c
@@ -22,7 +22,7 @@ SOFTWARE.
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: bootpef.c,v 1.7 2007/05/27 16:31:41 tls Exp $");
+__RCSID("$NetBSD: bootpef.c,v 1.8 2008/05/02 19:22:10 xtraeme Exp $");
#endif
@@ -90,7 +90,7 @@ int main(int, char **);
* General
*/
-char *progname;
+const char *progname;
char *chdir_path;
int debug = 0; /* Debugging flag (level) */
byte *buffer;
@@ -99,7 +99,7 @@ byte *buffer;
* Globals below are associated with the bootp database file (bootptab).
*/
-char *bootptab = CONFIG_FILE;
+const char *bootptab = CONFIG_FILE;
/*
diff --git a/usr.sbin/bootp/bootptest/bootptest.c b/usr.sbin/bootp/bootptest/bootptest.c
index b31a41867b4..6d7c589353e 100644
--- a/usr.sbin/bootp/bootptest/bootptest.c
+++ b/usr.sbin/bootp/bootptest/bootptest.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bootptest.c,v 1.16 2007/05/27 16:31:42 tls Exp $ */
+/* $NetBSD: bootptest.c,v 1.17 2008/05/02 19:22:10 xtraeme Exp $ */
/*
* bootptest.c - Test out a bootp server.
@@ -36,10 +36,10 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: bootptest.c,v 1.16 2007/05/27 16:31:42 tls Exp $");
+__RCSID("$NetBSD: bootptest.c,v 1.17 2008/05/02 19:22:10 xtraeme Exp $");
#endif
-char *usage = "usage: %s [-f bootfile] [-h] [-m magic_number] server-name\n"
+const char *usage = "usage: %s [-f bootfile] [-h] [-m magic_number] server-name\n"
" [vendor-data-template-file]\n";
#include <sys/param.h>
diff --git a/usr.sbin/bootp/bootptest/print-bootp.c b/usr.sbin/bootp/bootptest/print-bootp.c
index adc42d25887..c9dca2cb226 100644
--- a/usr.sbin/bootp/bootptest/print-bootp.c
+++ b/usr.sbin/bootp/bootptest/print-bootp.c
@@ -26,7 +26,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: print-bootp.c,v 1.8 2007/05/27 16:31:42 tls Exp $");
+__RCSID("$NetBSD: print-bootp.c,v 1.9 2008/05/02 19:22:10 xtraeme Exp $");
/* 93/10/10 <gwr@mc.com> New data-driven option print routine. */
#endif
@@ -195,7 +195,7 @@ bootp_print(struct bootp *bp, int length, u_short sport, u_short dport)
* l: int32
* s: short (16-bit)
*/
-char *
+const char *
rfc1048_opts[] = {
/* Originally from RFC-1048: */
"?PAD", /* 0: Padding - special, no data. */
@@ -280,7 +280,7 @@ rfc1048_print(u_char *bp, int length)
u_int32 ul;
u_short us;
struct in_addr ia;
- char *optstr;
+ const char *optstr;
printf("-rfc1395");
diff --git a/usr.sbin/bootp/common/bootpd.h b/usr.sbin/bootp/common/bootpd.h
index c5466d3466c..9d2a6a1a222 100644
--- a/usr.sbin/bootp/common/bootpd.h
+++ b/usr.sbin/bootp/common/bootpd.h
@@ -1,4 +1,4 @@
-/* $NetBSD: bootpd.h,v 1.4 1998/01/09 08:09:02 perry Exp $ */
+/* $NetBSD: bootpd.h,v 1.5 2008/05/02 19:22:10 xtraeme Exp $ */
/************************************************************************
Copyright 1988, 1991 by Carnegie Mellon University
@@ -201,8 +201,8 @@ struct host {
*/
extern int debug;
-extern char *bootptab;
-extern char *progname;
+extern const char *bootptab;
+extern const char *progname;
extern u_char vm_cmu[4];
extern u_char vm_rfc1048[4];
diff --git a/usr.sbin/bootp/common/dumptab.c b/usr.sbin/bootp/common/dumptab.c
index 464344f8b0b..46214bd5a15 100644
--- a/usr.sbin/bootp/common/dumptab.c
+++ b/usr.sbin/bootp/common/dumptab.c
@@ -1,8 +1,8 @@
-/* $NetBSD: dumptab.c,v 1.8 2007/05/27 16:31:42 tls Exp $ */
+/* $NetBSD: dumptab.c,v 1.9 2008/05/02 19:22:10 xtraeme Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: dumptab.c,v 1.8 2007/05/27 16:31:42 tls Exp $");
+__RCSID("$NetBSD: dumptab.c,v 1.9 2008/05/02 19:22:10 xtraeme Exp $");
#endif
/*
@@ -29,11 +29,11 @@ __RCSID("$NetBSD: dumptab.c,v 1.8 2007/05/27 16:31:42 tls Exp $");
static void dump_generic(FILE *, struct shared_bindata *);
static void dump_host(FILE *, struct host *);
static void list_ipaddresses(FILE *, struct in_addr_list *);
-void dumptab(char *);
+void dumptab(const char *);
#ifndef DEBUG
void
-dumptab(char *filename)
+dumptab(const char *filename)
{
report(LOG_INFO, "No dumptab support!");
}
@@ -45,7 +45,7 @@ dumptab(char *filename)
*/
void
-dumptab(char *filename)
+dumptab(const char *filename)
{
int n;
struct host *hp;
diff --git a/usr.sbin/bootp/common/hwaddr.h b/usr.sbin/bootp/common/hwaddr.h
index 0c07c5c76d9..4c2668c5f91 100644
--- a/usr.sbin/bootp/common/hwaddr.h
+++ b/usr.sbin/bootp/common/hwaddr.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hwaddr.h,v 1.4 2007/04/29 20:23:37 msaitoh Exp $ */
+/* $NetBSD: hwaddr.h,v 1.5 2008/05/02 19:22:10 xtraeme Exp $ */
/* hwaddr.h */
#ifndef HWADDR_H
@@ -13,7 +13,7 @@
*/
struct hwinfo {
unsigned int hlen;
- char *name;
+ const char *name;
};
extern struct hwinfo hwinfolist[];
diff --git a/usr.sbin/bootp/common/readfile.c b/usr.sbin/bootp/common/readfile.c
index 416e18631e0..a827c271ee3 100644
--- a/usr.sbin/bootp/common/readfile.c
+++ b/usr.sbin/bootp/common/readfile.c
@@ -22,7 +22,7 @@ SOFTWARE.
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: readfile.c,v 1.15 2007/05/27 16:31:42 tls Exp $");
+__RCSID("$NetBSD: readfile.c,v 1.16 2008/05/02 19:22:10 xtraeme Exp $");
#endif
@@ -131,13 +131,13 @@ __RCSID("$NetBSD: readfile.c,v 1.15 2007/05/27 16:31:42 tls Exp $");
*/
struct symbolmap {
- char *symbol;
+ const char *symbol;
int symbolcode;
};
struct htypename {
- char *name;
+ const char *name;
byte htype;
};
@@ -632,7 +632,7 @@ PRIVATE int
process_entry(struct host *host, char *src)
{
int retval;
- char *msg;
+ const char *msg;
if (!host || *src == '\0') {
return -1;
@@ -777,7 +777,7 @@ eval_symbol(char **symbol, struct host *hp)
byte *tmphaddr;
struct symbolmap *symbolptr;
u_int32 value;
- int32 timeoff;
+ int32 ltimeoff;
int i, numsymbols;
unsigned len;
int optype; /* Indicates boolean, addition, or deletion */
@@ -964,9 +964,9 @@ eval_symbol(char **symbol, struct host *hp)
if (!strncmp(tmpstr, "auto", 4)) {
hp->time_offset = secondswest;
} else {
- if (sscanf(tmpstr, "%d", &timeoff) != 1)
+ if (sscanf(tmpstr, "%d", &ltimeoff) != 1)
return E_BAD_LONGWORD;
- hp->time_offset = timeoff;
+ hp->time_offset = ltimeoff;
}
hp->flags.time_offset = TRUE;
}
@@ -1108,7 +1108,7 @@ eval_symbol(char **symbol, struct host *hp)
case SYM_MIN_WAIT:
PARSE_INT(min_wait);
- if (hp->min_wait < 0)
+ if (hp->min_wait == 0)
return E_BAD_VALUE;
break;
diff --git a/usr.sbin/bootp/common/report.c b/usr.sbin/bootp/common/report.c
index 243e0d50aa6..19d83222515 100644
--- a/usr.sbin/bootp/common/report.c
+++ b/usr.sbin/bootp/common/report.c
@@ -1,8 +1,8 @@
-/* $NetBSD: report.c,v 1.6 2002/07/14 00:26:18 wiz Exp $ */
+/* $NetBSD: report.c,v 1.7 2008/05/02 19:22:10 xtraeme Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: report.c,v 1.6 2002/07/14 00:26:18 wiz Exp $");
+__RCSID("$NetBSD: report.c,v 1.7 2008/05/02 19:22:10 xtraeme Exp $");
#endif
/*
@@ -59,7 +59,7 @@ report_init(int nolog)
* newlines and adds its own at the end).
*/
-static char *levelnames[] = {
+static const char *levelnames[] = {
#ifdef LOG_SALERT
"level(0): ",
"alert(1): ",