traceroute6(8): make WARNS=3 clean

This commit is contained in:
Ulrich Spörlein 2010-12-04 14:19:35 +00:00
parent f02cd756de
commit f42640a362
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216185
2 changed files with 14 additions and 15 deletions

View File

@ -25,7 +25,7 @@ BINMODE= 4555
CFLAGS+= -DIPSEC -DUSE_RFC2292BIS -DHAVE_POLL
CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I.
WARNS?= 1
WARNS?= 3
DPADD= ${LIBIPSEC}
LDADD= -lipsec

View File

@ -66,7 +66,7 @@
*/
#ifndef lint
static char copyright[] =
static const char copyright[] =
"@(#) Copyright (c) 1990, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
@ -322,7 +322,7 @@ void send_probe(int, u_long);
void *get_uphdr(struct ip6_hdr *, u_char *);
int get_hoplim(struct msghdr *);
double deltaT(struct timeval *, struct timeval *);
char *pr_type(int);
const char *pr_type(int);
int packet_ok(struct msghdr *, int, int);
void print(struct msghdr *, int);
const char *inetname(struct sockaddr *);
@ -372,12 +372,12 @@ main(argc, argv)
{
int mib[4] = { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_DEFHLIM };
char hbuf[NI_MAXHOST], src0[NI_MAXHOST], *ep;
int ch, i, on = 1, seq, rcvcmsglen, error, minlen;
int ch, i, on = 1, seq, rcvcmsglen, error;
struct addrinfo hints, *res;
static u_char *rcvcmsgbuf;
u_long probe, hops, lport;
struct hostent *hp;
size_t size;
size_t size, minlen;
uid_t uid;
/*
@ -671,11 +671,11 @@ main(argc, argv)
datalen = minlen;
else if (datalen >= MAXPACKET) {
fprintf(stderr,
"traceroute6: packet size must be %d <= s < %ld.\n",
minlen, (long)MAXPACKET);
"traceroute6: packet size must be %zu <= s < %d.\n",
minlen, MAXPACKET);
exit(1);
}
outpacket = (struct opacket *)malloc((unsigned)datalen);
outpacket = malloc(datalen);
if (!outpacket) {
perror("malloc");
exit(1);
@ -913,7 +913,7 @@ main(argc, argv)
for (hops = first_hop; hops <= max_hops; ++hops) {
struct in6_addr lastaddr;
int got_there = 0;
int unreachable = 0;
unsigned unreachable = 0;
printf("%2lu ", hops);
bzero(&lastaddr, sizeof(lastaddr));
@ -1089,7 +1089,7 @@ send_probe(seq, hops)
i = sendto(sndsock, (char *)outpacket, datalen, 0,
(struct sockaddr *)&Dst, Dst.sin6_len);
if (i < 0 || i != datalen) {
if (i < 0 || (u_long)i != datalen) {
if (i < 0)
perror("sendto");
printf("traceroute6: wrote %s %lu chars, ret=%d\n",
@ -1129,12 +1129,11 @@ deltaT(t1p, t2p)
/*
* Convert an ICMP "type" field to a printable string.
*/
char *
pr_type(t0)
int t0;
const char *
pr_type(int t0)
{
u_char t = t0 & 0xff;
char *cp;
const char *cp;
switch (t) {
case ICMP6_DST_UNREACH:
@ -1221,7 +1220,7 @@ packet_ok(mhdr, cc, seq)
cc -= hlen;
icp = (struct icmp6_hdr *)(buf + hlen);
#else
if (cc < sizeof(struct icmp6_hdr)) {
if (cc < (int)sizeof(struct icmp6_hdr)) {
if (verbose) {
if (getnameinfo((struct sockaddr *)from, from->sin6_len,
hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0)