mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
import of dnsmasq-2.31.tar.gz
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user