summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2014-04-23 08:44:51 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2014-04-23 08:44:51 +0000
commit7be5275df03c684158c0ecbf1f6428a80be8a760 (patch)
tree3c925e37ed8d5c306e5647004e242012cc79319d /usr.sbin
parentf5a165d7aa49f40819c4ffadb1efff39f4658e35 (diff)
Make this compile with -Wall et al.
OK benno@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/traceroute/Makefile8
-rw-r--r--usr.sbin/traceroute/traceroute.c8
-rw-r--r--usr.sbin/traceroute6/Makefile7
-rw-r--r--usr.sbin/traceroute6/traceroute6.c12
4 files changed, 20 insertions, 15 deletions
diff --git a/usr.sbin/traceroute/Makefile b/usr.sbin/traceroute/Makefile
index ecd28b0261b..5a448b0d406 100644
--- a/usr.sbin/traceroute/Makefile
+++ b/usr.sbin/traceroute/Makefile
@@ -1,6 +1,12 @@
-# $OpenBSD: Makefile,v 1.5 2013/04/15 15:51:46 deraadt Exp $
+# $OpenBSD: Makefile,v 1.6 2014/04/23 08:44:50 florian Exp $
PROG= traceroute
+
+CFLAGS+= -Wall -I${.CURDIR}
+CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes
+CFLAGS+= -Wmissing-declarations
+CFLAGS+= -Wshadow -Wpointer-arith -Wcast-qual
+
MAN= traceroute.8
BINOWN= root
BINMODE=4555
diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c
index 00936669357..5afad11e5ed 100644
--- a/usr.sbin/traceroute/traceroute.c
+++ b/usr.sbin/traceroute/traceroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: traceroute.c,v 1.112 2014/04/21 14:26:10 florian Exp $ */
+/* $OpenBSD: traceroute.c,v 1.113 2014/04/23 08:44:50 florian Exp $ */
/* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */
/*-
@@ -311,7 +311,7 @@ main(int argc, char *argv[])
int mib[4] = { CTL_NET, PF_INET, IPPROTO_IP, IPCTL_DEFTTL };
int ttl_flag = 0, incflag = 1, protoset = 0, sump = 0;
int ch, i, lsrr = 0, on = 1, probe, seq = 0, tos = 0, error;
- int last_tos, tos_returned;
+ int last_tos = 0, tos_returned;
struct addrinfo hints, *res;
size_t size = sizeof(max_ttl);
struct sockaddr_in from, to;
@@ -325,7 +325,6 @@ main(int argc, char *argv[])
long l;
uid_t uid;
u_int rtableid;
- socklen_t len;
if ((rcvsock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0)
err(5, "icmp socket");
@@ -649,7 +648,6 @@ main(int argc, char *argv[])
for (ttl = first_ttl; ttl && ttl <= max_ttl; ++ttl) {
int got_there = 0, unreachable = 0, timeout = 0, loss;
in_addr_t lastaddr = 0;
- quad_t dt;
printf("%2u ", ttl);
for (probe = 0, loss = 0; probe < nprobes; ++probe) {
@@ -1229,7 +1227,7 @@ print_asn(struct sockaddr_storage *ss)
struct rrsetinfo *answers = NULL;
int counter;
const u_char *uaddr;
- char qbuf[MAXDNAME], *qp;
+ char qbuf[MAXDNAME];
switch (ss->ss_family) {
case AF_INET:
diff --git a/usr.sbin/traceroute6/Makefile b/usr.sbin/traceroute6/Makefile
index 507b1f12588..31261755ff2 100644
--- a/usr.sbin/traceroute6/Makefile
+++ b/usr.sbin/traceroute6/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.7 2013/04/15 15:51:47 deraadt Exp $
+# $OpenBSD: Makefile,v 1.8 2014/04/23 08:44:50 florian Exp $
PROG= traceroute6
@@ -8,6 +8,11 @@ BINMODE=4555
CPPFLAGS+=-DINET6
+CFLAGS+= -Wall -I${.CURDIR}
+CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes
+CFLAGS+= -Wmissing-declarations
+CFLAGS+= -Wshadow -Wpointer-arith -Wcast-qual
+
MAN= traceroute6.8
.include <bsd.prog.mk>
diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c
index 5983d92a96a..d156b302284 100644
--- a/usr.sbin/traceroute6/traceroute6.c
+++ b/usr.sbin/traceroute6/traceroute6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: traceroute6.c,v 1.82 2014/04/18 16:58:02 florian Exp $ */
+/* $OpenBSD: traceroute6.c,v 1.83 2014/04/23 08:44:50 florian Exp $ */
/* $KAME: traceroute6.c,v 1.63 2002/10/24 12:53:25 itojun Exp $ */
/*
@@ -338,7 +338,6 @@ main(int argc, char *argv[])
struct addrinfo hints, *res;
static u_char *rcvcmsgbuf;
struct sockaddr_in6 from, to;
- struct hostent *hp;
size_t size;
u_int8_t hops;
long l;
@@ -479,7 +478,7 @@ main(int argc, char *argv[])
hints.ai_socktype = SOCK_RAW;
hints.ai_protocol = IPPROTO_ICMPV6;
hints.ai_flags = AI_CANONNAME;
- if (error = getaddrinfo(*argv, NULL, &hints, &res))
+ if ((error = getaddrinfo(*argv, NULL, &hints, &res)))
errx(1, "%s", gai_strerror(error));
if (res->ai_addrlen != sizeof(to))
errx(1, "size of sockaddr mismatch");
@@ -560,14 +559,11 @@ main(int argc, char *argv[])
*/
bzero(&from, sizeof(from));
if (source) {
- struct addrinfo hints, *res;
- int error;
-
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_DGRAM; /*dummy*/
hints.ai_flags = AI_NUMERICHOST;
- if(error = getaddrinfo(source, "0", &hints, &res))
+ if ((error = getaddrinfo(source, "0", &hints, &res)))
errx(1, "%s: %s", source, gai_strerror(error));
if (res->ai_addrlen != sizeof(from))
errx(1, "size of sockaddr mismatch");
@@ -1082,7 +1078,7 @@ print_asn(struct sockaddr_storage *ss)
struct rrsetinfo *answers = NULL;
int counter;
const u_char *uaddr;
- char qbuf[MAXDNAME], *qp;
+ char qbuf[MAXDNAME];
switch (ss->ss_family) {
case AF_INET: