diff options
Diffstat (limited to 'sbin/ping')
-rw-r--r-- | sbin/ping/Makefile | 9 | ||||
-rw-r--r-- | sbin/ping/ping.c | 7 |
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; } |