-# $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
-/* $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 $ */
/*-
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;
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");
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) {
struct rrsetinfo *answers = NULL;
int counter;
const u_char *uaddr;
- char qbuf[MAXDNAME], *qp;
+ char qbuf[MAXDNAME];
switch (ss->ss_family) {
case AF_INET:
-# $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
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>
-/* $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 $ */
/*
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;
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");
*/
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");
struct rrsetinfo *answers = NULL;
int counter;
const u_char *uaddr;
- char qbuf[MAXDNAME], *qp;
+ char qbuf[MAXDNAME];
switch (ss->ss_family) {
case AF_INET: