Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136390248
D8754.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D8754.diff
View Options
Index: head/sbin/ping/ping.c
===================================================================
--- head/sbin/ping/ping.c
+++ head/sbin/ping/ping.c
@@ -76,10 +76,8 @@
#include <netinet/ip_var.h>
#include <arpa/inet.h>
-#ifdef WITH_CASPER
#include <libcasper.h>
#include <casper/cap_dns.h>
-#endif
#ifdef IPSEC
#include <netipsec/ipsec.h>
@@ -204,15 +202,11 @@
static volatile sig_atomic_t finish_up;
static volatile sig_atomic_t siginfo_p;
-#ifdef WITH_CASPER
static cap_channel_t *capdns;
-#endif
static void fill(char *, char *);
static u_short in_cksum(u_short *, int);
-#ifdef WITH_CASPER
static cap_channel_t *capdns_setup(void);
-#endif
static void check_status(void);
static void finish(void) __dead2;
static void pinger(void);
@@ -563,21 +557,17 @@
if (options & F_PINGFILLED) {
fill((char *)datap, payload);
}
-#ifdef WITH_CASPER
capdns = capdns_setup();
-#endif
if (source) {
bzero((char *)&sock_in, sizeof(sock_in));
sock_in.sin_family = AF_INET;
if (inet_aton(source, &sock_in.sin_addr) != 0) {
shostname = source;
} else {
-#ifdef WITH_CASPER
if (capdns != NULL)
hp = cap_gethostbyname2(capdns, source,
AF_INET);
else
-#endif
hp = gethostbyname2(source, AF_INET);
if (!hp)
errx(EX_NOHOST, "cannot resolve %s: %s",
@@ -606,11 +596,9 @@
if (inet_aton(target, &to->sin_addr) != 0) {
hostname = target;
} else {
-#ifdef WITH_CASPER
if (capdns != NULL)
hp = cap_gethostbyname2(capdns, target, AF_INET);
else
-#endif
hp = gethostbyname2(target, AF_INET);
if (!hp)
errx(EX_NOHOST, "cannot resolve %s: %s",
@@ -624,7 +612,6 @@
hostname = hnamebuf;
}
-#ifdef WITH_CASPER
/* From now on we will use only reverse DNS lookups. */
if (capdns != NULL) {
const char *types[1];
@@ -633,7 +620,6 @@
if (cap_dns_type_limit(capdns, types, 1) < 0)
err(1, "unable to limit access to system.dns service");
}
-#endif
if (connect(ssend, (struct sockaddr *)&whereto, sizeof(whereto)) != 0)
err(1, "connect");
@@ -722,10 +708,8 @@
if (options & F_NUMERIC)
cansandbox = true;
-#ifdef WITH_CASPER
else if (capdns != NULL)
cansandbox = true;
-#endif
else
cansandbox = false;
@@ -1707,11 +1691,9 @@
if (options & F_NUMERIC)
return inet_ntoa(ina);
-#ifdef WITH_CASPER
if (capdns != NULL)
hp = cap_gethostbyaddr(capdns, (char *)&ina, 4, AF_INET);
else
-#endif
hp = gethostbyaddr((char *)&ina, 4, AF_INET);
if (hp == NULL)
@@ -1791,7 +1773,6 @@
}
}
-#ifdef WITH_CASPER
static cap_channel_t *
capdns_setup(void)
{
@@ -1817,7 +1798,6 @@
return (capdnsloc);
}
-#endif /* WITH_CASPER */
#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
#define SECOPT " [-P policy]"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 18, 1:38 PM (59 m, 44 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25515219
Default Alt Text
D8754.diff (2 KB)
Attached To
Mode
D8754: Convert ping to use libcaspermock when Casper is disabled.
Attached
Detach File
Event Timeline
Log In to Comment