summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd/bpf.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* explicitly use BPF_FILDROP_CAPTURE when configuring BIOCSFILDROPdlg2019-03-181-2/+3
| | | | | | | BIOCSFILDROP used to just be a flag, ie, any non-zero value was treated the same, but i'm changing it so different values do different things. this way the programs should keep working even if i decide to change the values for these macros.
* Switch base tools from /dev/bpf0 to /dev/bpf. Now that /dev/bpf has beennatano2017-04-191-2/+2
| | | | | | around for two releases, it should be safe to do so. ok bluhm deraadt sthen tb yasuoka
* Tweak parameters to decode_*, add a check or two, and thus gain most of thekrw2017-04-181-5/+5
| | | | | sanity improvements reyk@ recently put into dhcrelay to ensure no more than the captured packet is processed.
* After 11 years of pondering about it I think that brookdavis@freebsd.orgkrw2017-04-181-3/+3
| | | | | | had it correct. Don't BPF_WORDALIGN() the value for the number of bytes read() into the buffer. This could theoretically cause the processing of 1 - 3 more bytes than were read.
* Eliminate pointless'%m' (a.k.a. hand rolled strerror()) by using fatal() andkrw2017-02-131-13/+12
| | | | log_warn(). Zap a couple of explicit 'syslog()' calls.
* Switch from old errwarn.c logging to shiny new log.[ch].krw2017-02-131-14/+15
| | | | ok benno@
* Replace the /dev/bpf* open loop with a plain open("/dev/bpf0", ...).natano2016-05-281-20/+7
| | | | ok deraadt jca
* Eliminate #include inside *.h files and include only needed headers inkrw2016-02-061-5/+19
| | | | | | | each *.c file. Inspired by mention of header silliness by Edgar Pettijohn and mmcc@ on tech@.
* Remove unnecessary netinet/in_systm.h include.lteo2014-10-251-2/+1
| | | | ok millert@
* Add -u option to bind UDP port as a socket to answer DHCPINFORM fromyasuoka2014-07-111-1/+5
| | | | | | | the clients on non ethernet interfaces (eg. tun(4) or pppx(4)). input krw ok krw
* send_packet() and writev() return ssize_t, not int. Use correctkrw2013-04-051-2/+3
| | | | type to store the returned value. From dhill.
* Remove unused (a.k.a. always passed NULL) parameter 'data' fromkrw2013-02-031-2/+2
| | | | | decode_udp_ip_header() and the useless check of it. Part of original diff from pelikan about udp length errors.
* Just like dhclient(8), we use the bpf filter drop to preventmpf2009-12-141-1/+4
| | | | | us from sending an icmp error along with the dhcp reply. OK henning@
* When checking if a syscall like open(), ioctl() or writev() failed compareclaudio2008-09-151-11/+11
| | | | directly against -1 and do not use a < 0 test. OK henning@
* Fix erroneous use of '=' instead of '+' that caused infinite loopskrw2005-07-291-7/+13
| | | | | | | when skipping packets. Use BPF_WORDALIGN() to properly skip packets. From Brooks Davis at FreeBSD. ok deraadt@ henning@
* avoid aliasing with libc functions; ok henningderaadt2004-09-161-2/+2
|
* remove things not used, spotted by lint mostly; ok henningderaadt2004-05-041-4/+4
|
* filter writes and lock bpf descriptor, ok henning@canacar2004-04-211-14/+58
|
* dhcpd actually does not listen on port 68 ...henning2004-04-151-2/+2
|
* may the whacking beginhenning2004-04-131-0/+321