aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/ping
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2019-08-19 17:54:40 +0000
committerAlan Somers <asomers@FreeBSD.org>2019-08-19 17:54:40 +0000
commita3ce769851ebfdba2e58c17314358b7af5b3e618 (patch)
treeecad6665bb259aa5bddde7d66b14517b83f37d5b /sbin/ping
parent1974d7a40e0a56a01f05e03e22970bd4d042786a (diff)
downloadsrc-a3ce769851ebfdba2e58c17314358b7af5b3e618.tar.gz
src-a3ce769851ebfdba2e58c17314358b7af5b3e618.zip
Fix uninitialized variable warnings when MK_CASPER=no
Submitted by: Ján Sučan <sucanjan@gmail.com> MFC after: 2 weeks Sponsored by: Google, inc. (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21322
Notes
Notes: svn path=/head/; revision=351226
Diffstat (limited to 'sbin/ping')
-rw-r--r--sbin/ping/ping.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index 9ad51fbb7b45..4375c72322b8 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -610,6 +610,7 @@ main(int argc, char *const *argv)
}
/* From now on we will use only reverse DNS lookups. */
+#ifdef WITH_CASPER
if (capdns != NULL) {
const char *types[1];
@@ -617,7 +618,7 @@ main(int argc, char *const *argv)
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");
@@ -1709,9 +1710,10 @@ static cap_channel_t *
capdns_setup(void)
{
cap_channel_t *capcas, *capdnsloc;
+#ifdef WITH_CASPER
const char *types[2];
int families[1];
-
+#endif
capcas = cap_init();
if (capcas == NULL)
err(1, "unable to create casper process");
@@ -1720,6 +1722,7 @@ capdns_setup(void)
cap_close(capcas);
if (capdnsloc == NULL)
err(1, "unable to open system.dns service");
+#ifdef WITH_CASPER
types[0] = "NAME2ADDR";
types[1] = "ADDR2NAME";
if (cap_dns_type_limit(capdnsloc, types, 2) < 0)
@@ -1727,7 +1730,7 @@ capdns_setup(void)
families[0] = AF_INET;
if (cap_dns_family_limit(capdnsloc, families, 1) < 0)
err(1, "unable to limit access to system.dns service");
-
+#endif
return (capdnsloc);
}