summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd/bpf.c
diff options
context:
space:
mode:
authormpf <mpf@openbsd.org>2009-12-14 22:12:14 +0000
committermpf <mpf@openbsd.org>2009-12-14 22:12:14 +0000
commite7791a156016b29a497e7d9f47edd21925307a34 (patch)
tree14f5cfe5740c560ea9d5a3ab8389dd977a29b3b2 /usr.sbin/dhcpd/bpf.c
parentPass through the aixterm bright colours if the terminal supports them (>= 16 (diff)
downloadwireguard-openbsd-e7791a156016b29a497e7d9f47edd21925307a34.tar.xz
wireguard-openbsd-e7791a156016b29a497e7d9f47edd21925307a34.zip
Just like dhclient(8), we use the bpf filter drop to prevent
us from sending an icmp error along with the dhcp reply. OK henning@
Diffstat (limited to 'usr.sbin/dhcpd/bpf.c')
-rw-r--r--usr.sbin/dhcpd/bpf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/dhcpd/bpf.c b/usr.sbin/dhcpd/bpf.c
index ce3cd3b76b7..efa3fcff140 100644
--- a/usr.sbin/dhcpd/bpf.c
+++ b/usr.sbin/dhcpd/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.7 2008/09/15 20:38:17 claudio Exp $ */
+/* $OpenBSD: bpf.c,v 1.8 2009/12/14 22:12:14 mpf Exp $ */
/* BPF socket interface code, originally contributed by Archie Cobbs. */
@@ -191,6 +191,9 @@ if_register_receive(struct interface_info *info)
if (ioctl(info->rfdesc, BIOCIMMEDIATE, &flag) == -1)
error("Can't set immediate mode on bpf device: %m");
+ if (ioctl(info->rfdesc, BIOCSFILDROP, &flag) == -1)
+ error("Can't set filter-drop mode on bpf device: %m");
+
/* make sure kernel fills in the source ethernet address */
if (ioctl(info->rfdesc, BIOCSHDRCMPLT, &cmplt) == -1)
error("Can't set header complete flag on bpf device: %m");