summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-09-08 04:33:47 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-09-08 04:33:47 +0000
commit644c1e6569db30d6ed643782c4304ddb96ea5874 (patch)
treea03f7b75539066db79d1e734150a46cc2edc8058 /usr.sbin
parent2294e26524e0b551fe55591783e8f6c7d6c818a7 (diff)
Fix a bunch of -pedantic errors
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pppoe/client.c29
-rw-r--r--usr.sbin/pppoe/common.c20
-rw-r--r--usr.sbin/pppoe/pppoe.c9
-rw-r--r--usr.sbin/pppoe/pppoe.h8
-rw-r--r--usr.sbin/pppoe/server.c30
5 files changed, 48 insertions, 48 deletions
diff --git a/usr.sbin/pppoe/client.c b/usr.sbin/pppoe/client.c
index dceeb92a4e5..ed93c5da8c6 100644
--- a/usr.sbin/pppoe/client.c
+++ b/usr.sbin/pppoe/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.14 2002/02/17 19:42:39 millert Exp $ */
+/* $OpenBSD: client.c,v 1.15 2002/09/08 04:33:46 jason Exp $ */
/*
* Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net
@@ -66,14 +66,14 @@ u_int32_t client_cookie;
u_int16_t client_sessionid;
int pppfd, client_state;
-static int getpackets(int, char *, char *, struct ether_addr *,
+static int getpackets(int, u_int8_t *, u_int8_t *, struct ether_addr *,
struct ether_addr *);
static int send_padi(int, struct ether_addr *, u_int8_t *);
-static int send_padr(int, char *, struct ether_addr *, struct ether_addr *,
+static int send_padr(int, u_int8_t *, struct ether_addr *, struct ether_addr *,
struct ether_header *, struct pppoe_header *, struct tag_list *);
-static int recv_pado(int, char *, struct ether_addr *, struct ether_addr *,
+static int recv_pado(int, u_int8_t *, struct ether_addr *, struct ether_addr *,
struct ether_header *, struct pppoe_header *, u_long, u_int8_t *);
-static int recv_pads(int, char *, char *, struct ether_addr *,
+static int recv_pads(int, u_int8_t *, u_int8_t *, struct ether_addr *,
struct ether_addr *, struct ether_header *, struct pppoe_header *,
u_long, u_int8_t *);
static int recv_padt(int, struct ether_addr *, struct ether_addr *,
@@ -87,7 +87,7 @@ int timer_hit(void);
int
client_mode(bfd, sysname, srvname, myea)
int bfd;
- char *sysname, *srvname;
+ u_int8_t *sysname, *srvname;
struct ether_addr *myea;
{
struct ether_addr rmea;
@@ -197,7 +197,7 @@ send_padi(fd, ea, srv)
/* service-name tag */
tserv.type = htons(PPPOE_TAG_SERVICE_NAME);
- tserv.len = (srv == NULL) ? 0 : strlen(srv);
+ tserv.len = (srv == NULL) ? 0 : strlen((char *)srv);
tserv.val = srv;
ph.len += tserv.len + sizeof(tserv.type) + sizeof(tserv.len);
iov[6].iov_base = &tserv;
@@ -220,7 +220,7 @@ send_padi(fd, ea, srv)
static int
send_padr(bfd, srv, myea, rmea, eh, ph, tl)
int bfd;
- char *srv;
+ u_int8_t *srv;
struct ether_addr *myea, *rmea;
struct ether_header *eh;
struct pppoe_header *ph;
@@ -258,7 +258,7 @@ send_padr(bfd, srv, myea, rmea, eh, ph, tl)
iov[idx++].iov_len = sizeof(client_cookie);
/* Service-Name */
- slen = (srv == NULL) ? 0 : strlen(srv);
+ slen = (srv == NULL) ? 0 : strlen((char *)srv);
svtag.type = htons(PPPOE_TAG_SERVICE_NAME);
svtag.len = htons(slen);
iov[idx].iov_base = &svtag;
@@ -301,7 +301,7 @@ send_padr(bfd, srv, myea, rmea, eh, ph, tl)
static int
getpackets(bfd, srv, sysname, myea, rmea)
int bfd;
- char *srv, *sysname;
+ u_int8_t *srv, *sysname;
struct ether_addr *myea, *rmea;
{
static u_int8_t *pktbuf;
@@ -401,7 +401,7 @@ next:
static int
recv_pado(bfd, srv, myea, rmea, eh, ph, len, pkt)
int bfd;
- char *srv;
+ u_int8_t *srv;
struct ether_addr *myea, *rmea;
struct ether_header *eh;
struct pppoe_header *ph;
@@ -437,11 +437,12 @@ recv_pado(bfd, srv, myea, rmea, eh, ph, len, pkt)
goto out;
r = 0;
- slen = (srv == NULL) ? 0 : strlen(srv);
+ slen = (srv == NULL) ? 0 : strlen((char *)srv);
while ((n = tag_lookup(&tl, PPPOE_TAG_SERVICE_NAME, r)) != NULL) {
if (slen == 0 || n->len == 0)
break;
- if (n->len == slen && !strncmp(srv, n->val, slen))
+ if (n->len == slen && !strncmp((char *)srv,
+ (char *)n->val, slen))
break;
r++;
}
@@ -464,7 +465,7 @@ out:
static int
recv_pads(bfd, srv, sysname, myea, rmea, eh, ph, len, pkt)
int bfd;
- char *srv, *sysname;
+ u_int8_t *srv, *sysname;
struct ether_addr *myea, *rmea;
struct ether_header *eh;
struct pppoe_header *ph;
diff --git a/usr.sbin/pppoe/common.c b/usr.sbin/pppoe/common.c
index bd710da9dea..14291ea7f4c 100644
--- a/usr.sbin/pppoe/common.c
+++ b/usr.sbin/pppoe/common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.c,v 1.7 2002/09/06 19:57:10 deraadt Exp $ */
+/* $OpenBSD: common.c,v 1.8 2002/09/08 04:33:46 jason Exp $ */
/*
* Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net
@@ -66,7 +66,7 @@ void debugv(char *, struct iovec *, int);
int
runppp(bpffd, sysname)
int bpffd;
- char *sysname;
+ u_int8_t *sysname;
{
int socks[2], fdm, fds, closeit;
pid_t pid;
@@ -120,6 +120,8 @@ runppp(bpffd, sysname)
perror("execlp");
syslog(LOG_INFO, "%s exec failed: %m", PPP_PROG);
_exit(1);
+ /*NOTREACHED*/
+ return (-1);
}
int
@@ -147,10 +149,8 @@ bpf_to_ppp(pppfd, len, pkt)
}
int
-ppp_to_bpf(bfd, pppfd, myea, rmea, id)
- int bfd, pppfd;
- struct ether_addr *myea, *rmea;
- u_int16_t id;
+ppp_to_bpf(int bfd, int pppfd, struct ether_addr *myea,
+ struct ether_addr *rmea, u_int16_t id)
{
static u_int8_t *pktbuf = NULL;
struct pppoe_header ph;
@@ -243,10 +243,8 @@ out:
}
int
-send_padt(bpffd, src_ea, dst_ea, id)
- int bpffd;
- struct ether_addr *src_ea, *dst_ea;
- u_int16_t id;
+send_padt(int bpffd, struct ether_addr *src_ea,
+ struct ether_addr *dst_ea, u_int16_t id)
{
struct iovec iov[4];
struct pppoe_header ph;
@@ -273,7 +271,7 @@ u_int32_t
cookie_bake()
{
MD5_CTX ctx;
- char buf[40];
+ unsigned char buf[40];
u_int32_t x, y;
x = arc4random();
diff --git a/usr.sbin/pppoe/pppoe.c b/usr.sbin/pppoe/pppoe.c
index cc3451bb458..4165e947689 100644
--- a/usr.sbin/pppoe/pppoe.c
+++ b/usr.sbin/pppoe/pppoe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pppoe.c,v 1.7 2002/02/16 21:28:07 millert Exp $ */
+/* $OpenBSD: pppoe.c,v 1.8 2002/09/08 04:33:46 jason Exp $ */
/*
* Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net
@@ -68,7 +68,8 @@ int signal_init(void);
int
main(int argc, char **argv) {
- char *ifname = NULL, *sysname = NULL, *srvname = NULL;
+ char *ifname = NULL;
+ u_int8_t *sysname = NULL, *srvname = NULL;
char ifnambuf[IFNAMSIZ];
struct ether_addr ea;
int bpffd, smode = 0, c;
@@ -87,14 +88,14 @@ main(int argc, char **argv) {
usage();
return (EX_USAGE);
}
- srvname = optarg;
+ srvname = (u_int8_t *)optarg;
break;
case 'p':
if (sysname != NULL) {
usage();
return (EX_USAGE);
}
- sysname = optarg;
+ sysname = (u_int8_t *)optarg;
break;
case 's':
if (smode) {
diff --git a/usr.sbin/pppoe/pppoe.h b/usr.sbin/pppoe/pppoe.h
index 9e4762e6c8a..86c89ec1f31 100644
--- a/usr.sbin/pppoe/pppoe.h
+++ b/usr.sbin/pppoe/pppoe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pppoe.h,v 1.4 2002/02/17 19:42:39 millert Exp $ */
+/* $OpenBSD: pppoe.h,v 1.5 2002/09/08 04:33:46 jason Exp $ */
/*
* Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net
@@ -89,8 +89,8 @@ struct pppoe_tag {
extern int option_verbose;
extern u_char etherbroadcastaddr[];
-void server_mode(int, char *, char *, struct ether_addr *);
-int client_mode(int, char *, char *, struct ether_addr *);
+void server_mode(int, u_int8_t *, u_int8_t *, struct ether_addr *);
+int client_mode(int, u_int8_t *, u_int8_t *, struct ether_addr *);
struct tag_list {
LIST_HEAD(, tag_node) thelist;
@@ -134,7 +134,7 @@ struct pppoe_session *session_new(struct ether_addr *);
struct pppoe_session *session_find_eaid(struct ether_addr *, u_int16_t);
struct pppoe_session *session_find_fd(int);
-int runppp(int, char *);
+int runppp(int, u_int8_t *);
int bpf_to_ppp(int, u_long, u_int8_t *);
int ppp_to_bpf(int, int, struct ether_addr *, struct ether_addr *, u_int16_t);
int send_padt(int, struct ether_addr *, struct ether_addr *, u_int16_t);
diff --git a/usr.sbin/pppoe/server.c b/usr.sbin/pppoe/server.c
index dc686093755..e65eb946cb7 100644
--- a/usr.sbin/pppoe/server.c
+++ b/usr.sbin/pppoe/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.8 2002/09/06 19:57:24 deraadt Exp $ */
+/* $OpenBSD: server.c,v 1.9 2002/09/08 04:33:46 jason Exp $ */
/*
* Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net
@@ -60,20 +60,20 @@
#define COOKIE_LEN 4 /* bytes/cookie, must be <= 16 */
#define COOKIE_MAX 16
-static char ac_cookie_key[8];
+static u_int8_t ac_cookie_key[8];
-static void getpackets(int, char *, struct ether_addr *);
+static void getpackets(int, u_int8_t *, struct ether_addr *);
static void recv_padi(int, struct ether_addr *,
struct ether_header *, struct pppoe_header *, u_long, u_int8_t *);
-static void recv_padr(int, char *, struct ether_addr *,
+static void recv_padr(int, u_int8_t *, struct ether_addr *,
struct ether_header *, struct pppoe_header *, u_long, u_int8_t *);
static void recv_padt(int, struct ether_addr *,
struct ether_header *, struct pppoe_header *, u_long, u_int8_t *);
static void send_pado(int, struct ether_addr *,
struct ether_header *, struct pppoe_header *, u_long, u_int8_t *);
-static void send_pads(int, char *, struct ether_addr *,
+static void send_pads(int, u_int8_t *, struct ether_addr *,
struct ether_header *, struct pppoe_header *, u_long, u_int8_t *);
static void key_gen(void);
static u_int8_t *key_make(u_int8_t *, int, u_int8_t *, int);
@@ -82,7 +82,7 @@ static int key_cmp(u_int8_t *, int, u_int8_t *, int, u_int8_t *, int);
void
server_mode(bpffd, sysname, srvname, ea)
int bpffd;
- char *sysname, *srvname;
+ u_int8_t *sysname, *srvname;
struct ether_addr *ea;
{
struct pppoe_session *ses;
@@ -204,7 +204,7 @@ key_cmp(k, klen, in1, in1len, in2, in2len)
static void
getpackets(bpffd, sysname, ea)
int bpffd;
- char *sysname;
+ u_int8_t *sysname;
struct ether_addr *ea;
{
static u_int8_t *pktbuf;
@@ -327,7 +327,7 @@ send_pado(bpffd, ea, eh, ph, pktlen, pktbuf)
u_int8_t *pktbuf;
{
struct pppoe_tag ktag, htag;
- char hn[MAXHOSTNAMELEN];
+ u_int8_t hn[MAXHOSTNAMELEN];
u_int8_t *k = NULL;
struct iovec v[7];
int idx = 0;
@@ -342,9 +342,9 @@ send_pado(bpffd, ea, eh, ph, pktlen, pktbuf)
v[idx].iov_base = pktbuf; v[idx].iov_len = pktlen; idx++;
- if (gethostname(hn, sizeof(hn)) < 0)
+ if (gethostname((char *)hn, sizeof(hn)) < 0)
return;
- htag.len = strlen(hn);
+ htag.len = strlen((char *)hn);
htag.type = htons(PPPOE_TAG_AC_NAME);
htag.val = hn;
v[idx].iov_base = &htag;
@@ -379,7 +379,7 @@ send_pado(bpffd, ea, eh, ph, pktlen, pktbuf)
static void
recv_padr(bpffd, sysname, ea, eh, ph, pktlen, pktbuf)
int bpffd;
- char *sysname;
+ u_int8_t *sysname;
struct ether_addr *ea;
struct ether_header *eh;
struct pppoe_header *ph;
@@ -411,14 +411,14 @@ recv_padr(bpffd, sysname, ea, eh, ph, pktlen, pktbuf)
static void
send_pads(bpffd, sysname, ea, eh, ph, pktlen, pktbuf)
int bpffd;
- char *sysname;
+ u_int8_t *sysname;
struct ether_addr *ea;
struct ether_header *eh;
struct pppoe_header *ph;
u_long pktlen;
u_int8_t *pktbuf;
{
- char hn[MAXHOSTNAMELEN];
+ u_int8_t hn[MAXHOSTNAMELEN];
struct iovec v[16];
struct pppoe_session *s;
struct pppoe_tag htag;
@@ -435,13 +435,13 @@ send_pads(bpffd, sysname, ea, eh, ph, pktlen, pktbuf)
ph->code = PPPOE_CODE_PADS;
ph->sessionid = htons(s->s_id);
- if (gethostname(hn, sizeof(hn)) < 0)
+ if (gethostname((char *)hn, sizeof(hn)) < 0)
return;
v[idx].iov_base = ph; v[idx].iov_len = sizeof(*ph); idx++;
v[idx].iov_base = pktbuf; v[idx].iov_len = pktlen; idx++;
- htag.len = strlen(hn);
+ htag.len = strlen((char *)hn);
htag.type = htons(PPPOE_TAG_AC_NAME);
htag.val = hn;
v[idx].iov_base = &htag;