summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2009-12-14 22:12:15 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2009-12-14 22:12:15 +0000
commit44ac231887907592b7627ceab5569a53e94061b8 (patch)
tree14f8ab36affd1f345aec81975f38542eeeac974c /usr.sbin/dhcpd
parent1081ffa5fe78575fa11ee7aa2ed07cf55a0411db (diff)
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')
-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");