Lines 61-66
__FBSDID("$FreeBSD$");
Link Here
|
61 |
|
61 |
|
62 |
#include <sys/capsicum.h> |
62 |
#include <sys/capsicum.h> |
63 |
#include <sys/endian.h> |
63 |
#include <sys/endian.h> |
|
|
64 |
#include <sys/sysctl.h> |
64 |
|
65 |
|
65 |
#include <net80211/ieee80211_freebsd.h> |
66 |
#include <net80211/ieee80211_freebsd.h> |
66 |
|
67 |
|
Lines 96-101
int nullfd = -1;
Link Here
|
96 |
|
97 |
|
97 |
char hostname[_POSIX_HOST_NAME_MAX + 1]; |
98 |
char hostname[_POSIX_HOST_NAME_MAX + 1]; |
98 |
|
99 |
|
|
|
100 |
int is_xen_guest = -1; |
101 |
|
99 |
struct iaddr iaddr_broadcast = { 4, { 255, 255, 255, 255 } }; |
102 |
struct iaddr iaddr_broadcast = { 4, { 255, 255, 255, 255 } }; |
100 |
struct in_addr inaddr_any, inaddr_broadcast; |
103 |
struct in_addr inaddr_any, inaddr_broadcast; |
101 |
|
104 |
|
Lines 351-356
main(int argc, char *argv[])
Link Here
|
351 |
struct passwd *pw; |
354 |
struct passwd *pw; |
352 |
pid_t otherpid; |
355 |
pid_t otherpid; |
353 |
cap_rights_t rights; |
356 |
cap_rights_t rights; |
|
|
357 |
char vm_guest[16]; |
358 |
size_t sysctl_len = sizeof(vm_guest); |
354 |
|
359 |
|
355 |
/* Initially, log errors to stderr as well as to syslogd. */ |
360 |
/* Initially, log errors to stderr as well as to syslogd. */ |
356 |
openlog(__progname, LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); |
361 |
openlog(__progname, LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); |
Lines 462-467
main(int argc, char *argv[])
Link Here
|
462 |
if (gethostname(hostname, sizeof(hostname)) < 0) |
467 |
if (gethostname(hostname, sizeof(hostname)) < 0) |
463 |
hostname[0] = '\0'; |
468 |
hostname[0] = '\0'; |
464 |
|
469 |
|
|
|
470 |
/* |
471 |
* Check if running in a Xen VM before entering capability mode. |
472 |
*/ |
473 |
if (sysctlbyname("kern.vm_guest", vm_guest, &sysctl_len, NULL, 0) == 0) |
474 |
if (strcasecmp(vm_guest, "xen") == 0) |
475 |
is_xen_guest = 1; |
476 |
|
465 |
priv_script_init("PREINIT", NULL); |
477 |
priv_script_init("PREINIT", NULL); |
466 |
if (ifi->client->alias) |
478 |
if (ifi->client->alias) |
467 |
priv_script_write_params("alias_", ifi->client->alias); |
479 |
priv_script_write_params("alias_", ifi->client->alias); |