Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/traceroute6/traceroute6.c
Show First 20 Lines • Show All 1,521 Lines • ▼ Show 20 Lines | while (lim - cp >= (nh == IPPROTO_NONE ? 0 : 8)) { | ||||
cp += hlen; | cp += hlen; | ||||
} | } | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
void | void | ||||
capdns_open() | capdns_open(void) | ||||
{ | { | ||||
#ifdef WITH_CASPER | |||||
const char *types[] = { "NAME", "ADDR" }; | const char *types[] = { "NAME", "ADDR" }; | ||||
int families[1]; | int families[1]; | ||||
cap_channel_t *casper; | cap_channel_t *casper; | ||||
casper = cap_init(); | casper = cap_init(); | ||||
if (casper == NULL) | if (casper == NULL) | ||||
errx(1, "unable to create casper process"); | errx(1, "unable to create casper process"); | ||||
capdns = cap_service_open(casper, "system.dns"); | capdns = cap_service_open(casper, "system.dns"); | ||||
if (capdns == NULL) | if (capdns == NULL) | ||||
errx(1, "unable to open system.dns service"); | errx(1, "unable to open system.dns service"); | ||||
if (cap_dns_type_limit(capdns, types, nitems(types)) < 0) | if (cap_dns_type_limit(capdns, types, nitems(types)) < 0) | ||||
errx(1, "unable to limit access to system.dns service"); | errx(1, "unable to limit access to system.dns service"); | ||||
families[0] = AF_INET6; | families[0] = AF_INET6; | ||||
if (cap_dns_family_limit(capdns, families, nitems(families)) < 0) | if (cap_dns_family_limit(capdns, families, nitems(families)) < 0) | ||||
errx(1, "unable to limit access to system.dns service"); | errx(1, "unable to limit access to system.dns service"); | ||||
cap_close(casper); | cap_close(casper); | ||||
#endif /* WITH_CASPER */ | |||||
} | } | ||||
void | void | ||||
print(struct msghdr *mhdr, int cc) | print(struct msghdr *mhdr, int cc) | ||||
{ | { | ||||
struct sockaddr_in6 *from = (struct sockaddr_in6 *)mhdr->msg_name; | struct sockaddr_in6 *from = (struct sockaddr_in6 *)mhdr->msg_name; | ||||
char hbuf[NI_MAXHOST]; | char hbuf[NI_MAXHOST]; | ||||
▲ Show 20 Lines • Show All 252 Lines • Show Last 20 Lines |