summaryrefslogtreecommitdiffstats
path: root/sbin/ping
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committersjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit65145fa4c81da358fcbc3b650156dab705dfa34e (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /sbin/ping
parent60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff)
parente6b664c390af88d4a87208bc042ce503da664c3b (diff)
downloadFreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip
FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz
Merge sync of head
Diffstat (limited to 'sbin/ping')
-rw-r--r--sbin/ping/Makefile9
-rw-r--r--sbin/ping/ping.c7
2 files changed, 5 insertions, 11 deletions
diff --git a/sbin/ping/Makefile b/sbin/ping/Makefile
index 57f82a8..533f8b8 100644
--- a/sbin/ping/Makefile
+++ b/sbin/ping/Makefile
@@ -8,19 +8,16 @@ MAN= ping.8
BINOWN= root
BINMODE=4555
WARNS?= 3
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
.if ${MK_CASPER} != "no" && !defined(RESCUE)
-DPADD+= ${LIBCAPSICUM} ${LIBNV}
-LDADD+= -lcapsicum -lnv
+LIBADD+= capsicum
CFLAGS+=-DHAVE_LIBCAPSICUM
.endif
.if !defined(RELEASE_CRUNCH)
CFLAGS+=-DIPSEC
-DPADD+= ${LIBIPSEC}
-LDADD+= -lipsec
+LIBADD+= ipsec
.endif
.include <bsd.prog.mk>
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index aeb3014..23d5696 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -713,7 +713,7 @@ main(int argc, char *const *argv)
ip->ip_hl = sizeof(struct ip) >> 2;
ip->ip_tos = tos;
ip->ip_id = 0;
- ip->ip_off = df ? IP_DF : 0;
+ ip->ip_off = htons(df ? IP_DF : 0);
ip->ip_ttl = ttl;
ip->ip_p = IPPROTO_ICMP;
ip->ip_src.s_addr = source ? sock_in.sin_addr.s_addr : INADDR_ANY;
@@ -737,9 +737,6 @@ main(int argc, char *const *argv)
if (cansandbox && cap_enter() < 0 && errno != ENOSYS)
err(1, "cap_enter");
- if (cap_sandboxed())
- fprintf(stderr, "capability mode sandbox enabled\n");
-
cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT);
if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS)
err(1, "cap_rights_limit srecv");
@@ -1078,7 +1075,7 @@ pinger(void)
if (options & F_HDRINCL) {
cc += sizeof(struct ip);
ip = (struct ip *)outpackhdr;
- ip->ip_len = cc;
+ ip->ip_len = htons(cc);
ip->ip_sum = in_cksum((u_short *)outpackhdr, cc);
packet = outpackhdr;
}
OpenPOWER on IntegriCloud