Index: head/sbin/ping/ping.c =================================================================== --- head/sbin/ping/ping.c +++ head/sbin/ping/ping.c @@ -76,10 +76,8 @@ #include #include -#ifdef WITH_CASPER #include #include -#endif #ifdef IPSEC #include @@ -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]"