import of dnsmasq-2.31.tar.gz

This commit is contained in:
Simon Kelley
2006-05-06 14:13:33 +01:00
parent 26d0dbaf24
commit 7cebd20fe7
32 changed files with 2294 additions and 2141 deletions

View File

@@ -48,7 +48,12 @@ void init_bpf(struct daemon *daemon)
{
sprintf(ifreq.iov_base, "/dev/bpf%d", i++);
if ((daemon->dhcp_raw_fd = open(ifreq.iov_base, O_RDWR, 0)) != -1)
return;
{
int flags = fcntl(daemon->dhcp_raw_fd, F_GETFD);
if (flags != -1)
fcntl(daemon->dhcp_raw_fd, F_SETFD, flags | FD_CLOEXEC);
return;
}
}
if (errno != EBUSY)
die(_("cannot create DHCP BPF socket: %s"), NULL);