aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/ping
diff options
context:
space:
mode:
authorMariusz Zaborski <oshogbo@FreeBSD.org>2017-09-21 14:41:41 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2017-09-21 14:41:41 +0000
commit2560d18180bb351214175a0cd0ff518ae6c2ab96 (patch)
tree8f93335cbd7c4a0e2c125da275e04829f2cd779a /sbin/ping
parent6d2e5f3ddfa6777cd4925c57cd043950d047116a (diff)
downloadsrc-2560d18180bb351214175a0cd0ff518ae6c2ab96.tar.gz
src-2560d18180bb351214175a0cd0ff518ae6c2ab96.zip
We use a few different ifdef's names to check if we are using Casper or not,
let's standardize this. Now we are always use WITH_CASPER name. Discussed with: emaste@ MFC after: 1 month
Notes
Notes: svn path=/head/; revision=323866
Diffstat (limited to 'sbin/ping')
-rw-r--r--sbin/ping/Makefile2
-rw-r--r--sbin/ping/ping.c22
2 files changed, 12 insertions, 12 deletions
diff --git a/sbin/ping/Makefile b/sbin/ping/Makefile
index 21a4dccc01d9..12f00ffe5d1f 100644
--- a/sbin/ping/Makefile
+++ b/sbin/ping/Makefile
@@ -14,7 +14,7 @@ LIBADD= m
.if ${MK_CASPER} != "no" && !defined(RESCUE)
LIBADD+= casper
LIBADD+= cap_dns
-CFLAGS+=-DHAVE_LIBCASPER
+CFLAGS+=-DWITH_CASPER
.endif
.if !defined(RELEASE_CRUNCH)
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index 87817a67862b..266dd0c96cf9 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip_var.h>
#include <arpa/inet.h>
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
#include <libcasper.h>
#include <casper/cap_dns.h>
#endif
@@ -204,13 +204,13 @@ static double tsumsq = 0.0; /* sum of all times squared, for std. dev. */
static volatile sig_atomic_t finish_up;
static volatile sig_atomic_t siginfo_p;
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
static cap_channel_t *capdns;
#endif
static void fill(char *, char *);
static u_short in_cksum(u_short *, int);
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
static cap_channel_t *capdns_setup(void);
#endif
static void check_status(void);
@@ -563,7 +563,7 @@ main(int argc, char *const *argv)
if (options & F_PINGFILLED) {
fill((char *)datap, payload);
}
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
capdns = capdns_setup();
#endif
if (source) {
@@ -572,7 +572,7 @@ main(int argc, char *const *argv)
if (inet_aton(source, &sock_in.sin_addr) != 0) {
shostname = source;
} else {
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
if (capdns != NULL)
hp = cap_gethostbyname2(capdns, source,
AF_INET);
@@ -606,7 +606,7 @@ main(int argc, char *const *argv)
if (inet_aton(target, &to->sin_addr) != 0) {
hostname = target;
} else {
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
if (capdns != NULL)
hp = cap_gethostbyname2(capdns, target, AF_INET);
else
@@ -624,7 +624,7 @@ main(int argc, char *const *argv)
hostname = hnamebuf;
}
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
/* From now on we will use only reverse DNS lookups. */
if (capdns != NULL) {
const char *types[1];
@@ -722,7 +722,7 @@ main(int argc, char *const *argv)
if (options & F_NUMERIC)
cansandbox = true;
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
else if (capdns != NULL)
cansandbox = true;
#endif
@@ -1707,7 +1707,7 @@ pr_addr(struct in_addr ina)
if (options & F_NUMERIC)
return inet_ntoa(ina);
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
if (capdns != NULL)
hp = cap_gethostbyaddr(capdns, (char *)&ina, 4, AF_INET);
else
@@ -1791,7 +1791,7 @@ fill(char *bp, char *patp)
}
}
-#ifdef HAVE_LIBCASPER
+#ifdef WITH_CASPER
static cap_channel_t *
capdns_setup(void)
{
@@ -1817,7 +1817,7 @@ capdns_setup(void)
return (capdnsloc);
}
-#endif /* HAVE_LIBCASPER */
+#endif /* WITH_CASPER */
#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
#define SECOPT " [-P policy]"