summaryrefslogtreecommitdiff
path: root/sbin/ping
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2014-07-11 15:26:56 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2014-07-11 15:26:56 +0000
commitb3cce4b6a8523c1ef3eb19fb987162bc362b1ced (patch)
treef82497975a29cac7a6c0511fa924023d62903481 /sbin/ping
parent015c93e1f26786141810e4909570e8982aa00529 (diff)
use optval for setsockopt; sync with ping6
OK benno@
Diffstat (limited to 'sbin/ping')
-rw-r--r--sbin/ping/ping.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index 7e669fec9de..121c0b6e71d 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping.c,v 1.108 2014/07/09 15:24:19 florian Exp $ */
+/* $OpenBSD: ping.c,v 1.109 2014/07/11 15:26:55 florian Exp $ */
/* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */
/*
@@ -179,7 +179,7 @@ main(int argc, char *argv[])
struct hostent *hp;
struct sockaddr_in *to;
struct in_addr saddr;
- int ch, hold = 1, i, packlen, preload, maxsize, df = 0, tos = 0;
+ int ch, i, optval = 1, packlen, preload, maxsize, df = 0, tos = 0;
u_char *datap, *packet, ttl = MAXTTL, loop = 1;
char *target, hnamebuf[MAXHOSTNAMELEN];
char rspace[3 + 4 * NROUTES + 1]; /* record route space */
@@ -394,8 +394,8 @@ main(int argc, char *argv[])
}
if (options & F_SO_DEBUG)
- (void)setsockopt(s, SOL_SOCKET, SO_DEBUG, &hold,
- sizeof(hold));
+ (void)setsockopt(s, SOL_SOCKET, SO_DEBUG, &optval,
+ sizeof(optval));
if (options & F_TTL) {
if (IN_MULTICAST(ntohl(to->sin_addr.s_addr)))
@@ -411,7 +411,7 @@ main(int argc, char *argv[])
if (options & F_HDRINCL) {
struct ip *ip = (struct ip *)outpackhdr;
- setsockopt(s, IPPROTO_IP, IP_HDRINCL, &hold, sizeof(hold));
+ setsockopt(s, IPPROTO_IP, IP_HDRINCL, &optval, sizeof(optval));
ip->ip_v = IPVERSION;
ip->ip_hl = sizeof(struct ip) >> 2;
ip->ip_tos = tos;