diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2016-09-10 07:39:50 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2016-09-10 07:39:50 +0000 |
commit | 954a276dcf3300f8aaf59d0d49c2c3594aaa38d8 (patch) | |
tree | 4d3637fb49ade0a2b0143199032ec310e7b4a3cf /sbin | |
parent | 6fb531edd0a2a7605c810625d248dc3f1627406d (diff) |
packet is actually u_char, pass it around as one
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ping/ping.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index ef60005948a..ba334fbde72 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.155 2016/09/10 07:31:43 florian Exp $ */ +/* $OpenBSD: ping.c,v 1.156 2016/09/10 07:39:49 florian Exp $ */ /* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */ /* @@ -175,7 +175,7 @@ void onsignal(int); void retransmit(void); int pinger(void); const char *pr_addr(struct sockaddr *, socklen_t); -void pr_pack(char *, int, struct msghdr *); +void pr_pack(u_char *, int, struct msghdr *); __dead void usage(void); int in_cksum(u_short *, int); @@ -771,7 +771,7 @@ pinger(void) * program to be run without having intermingled output (or statistics!). */ void -pr_pack(char *buf, int cc, struct msghdr *mhdr) +pr_pack(u_char *buf, int cc, struct msghdr *mhdr) { struct sockaddr_in *from, s_in; socklen_t fromlen; @@ -921,7 +921,7 @@ pr_pack(char *buf, int cc, struct msghdr *mhdr) } /* Display any IP options */ - cp = (u_char *)buf + sizeof(struct ip); + cp = buf + sizeof(struct ip); for (; hlen > (int)sizeof(struct ip); --hlen, ++cp) switch (*cp) { @@ -971,7 +971,7 @@ pr_pack(char *buf, int cc, struct msghdr *mhdr) if (i <= 0) continue; if (i == old_rrlen && - cp == (u_char *)buf + sizeof(struct ip) + 2 && + cp == buf + sizeof(struct ip) + 2 && !memcmp(cp, old_rr, i) && !(options & F_FLOOD)) { (void)printf("\t(same route)"); |