summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcrelay (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use pw->pw_dir when chroot'ing, not _PATH_VAREMPTY.krw2019-08-061-2/+2
| | | | | | | Brings various dhcp related daemons into line with the common idiom. ok florian@
* Consistently spell "IPsec" in comments and debug outputs.mpi2018-03-161-2/+2
| | | | From Raf Czlonka, ok sthen@
* Handle carp(4) as HTYPE_ETHER.reyk2017-07-071-6/+7
| | | | | | This fixes "dhcrelay -i carpX" that used to work when dhcrelay didn't care. Reported and tested by Kapetanakis Giannis bilias at edu.physics.uoc.gr
* Don't stop logging to stderr when running in foreground with -d.reyk2017-07-051-4/+3
| | | | Pointed out by Kapetanakis Giannis
* 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
* We can enable many -W compiler warnings now.reyk2017-04-051-1/+5
| | | | OK rzalamena@
* Rework the packet.c code for decoding and assembling DHCP messages.reyk2017-04-053-84/+122
| | | | | | | | | | This code suffered from many years of incremental improvements, fix it to: - verify available buffer space in all cases and don't just trust the caller - have an API where you always pass the full buffer length and absolute offset - use consistent types for lengths and buffer offsets (int vs. size_t, ssize_t) - don't just ignore errors, return and fail when something is wrong OK rzalamena@
* The unsigned result cannot be -1, turn it into a signed variable.reyk2017-04-041-2/+2
| | | | OK rzalamena@
* constify pc_remote and pc_circuitreyk2017-04-042-6/+6
| | | | OK rzalamena@
* From a syslog perspective it does not make sense to log fatal andbluhm2017-03-211-6/+6
| | | | | | warn with the same severity. Switch log_warn() to LOG_ERR and keep fatal() at LOG_CRIT. OK reyk@ florian@
* Move the server struct to header file and make it compatible with IPv6.rzalamena2017-03-162-17/+20
| | | | ok reyk@
* Improve the interface and addresses discovery code and prepare torzalamena2017-03-153-57/+160
| | | | | | receive IPv6 support. ok reyk@
* Remove some global variables that are not being used.rzalamena2017-03-142-22/+8
| | | | ok gsoares@, jca@
* Adopt the common verbiage other log.[ch] daemons use to describe '-d'.krw2017-02-151-7/+6
| | | | Point out that dhcpd(8) -f is an alias for -d.
* Eliminate pointless'%m' (a.k.a. hand rolled strerror()) by using fatal() andkrw2017-02-133-36/+32
| | | | log_warn(). Zap a couple of explicit 'syslog()' calls.
* Adjust some long lines.krw2017-02-133-8/+11
|
* Do the strerror() elimination dance with a log_warnx() -> log_warn().krw2017-02-131-3/+2
|
* Banished to the attic.krw2017-02-131-213/+0
|
* Switch from old errwarn.c logging to shiny new log.[ch].krw2017-02-137-84/+333
| | | | ok benno@
* Add dhcrelay(8) command-line option for replacing Relay Agent Informationrzalamena2016-12-162-8/+18
| | | | | | | on the incoming packets. Man page tweaks from jmc@ ok reyk@
* Unbreak the dhcrelay(8) support to run on enc(4) interfaces.rzalamena2016-12-131-2/+3
| | | | ok reyk@
* Unbreak the insertion of Relay Agent Information on layer 3 mode whenrzalamena2016-12-131-9/+16
| | | | | | using the default values: use the right address for remote-id. ok reyk@
* Filter DHCP reply messages that were not meant for us by looking at therzalamena2016-12-131-1/+6
| | | | | | gateway set. This happens mostly because we are watching a BPF socket. Suggested by and ok jca@
* simplify previous; ok reykjmc2016-12-132-5/+5
|
* Implement support for layer 2 relaying and add further Relay Agentrzalamena2016-12-126-102/+524
| | | | | | | Information (RFC 3046) options. While at there change the naming of the remote destination parameters: instead of "server" call it "destination". ok reyk@
* Clean up function prototypes: use a single struct to hold all addressrzalamena2016-12-085-85/+104
| | | | | | | | information instead of passing multiple different parameters. This also prepares the dhcrelay code to receive new features, like: IPv6, layer 2 relaying. ok jca@
* Simplify get_interfaces function, make it return NULL if we didn't findrzalamena2016-12-084-27/+31
| | | | | | | the interface and abort dhcrelay with a more friendly message when we don't have an address configured in the interface. ok jca@
* DHCP requests can be relayed through multiple relays. Currently wepatrick2016-12-071-11/+14
| | | | | | | | | | | | | drop requests that have already been relayed. To allow usage in the middle of a chain, remove this check and only set giaddr if it has not been set yet. This giaddr will be used by the DHCP server to identify which subnet the client is connected to. RFC 1542 specifies that we should increase the hop counter every time we relay a request. If we receive a request whose hop counter exceeds the value of 16 we must silently drop it. ok jca@
* If the BROADCAST flag is set on a BOOTREPLY, the RFC specifies thatpatrick2016-12-071-7/+15
| | | | | | | | we SHOULD forward the packet not only as L3 broadcast, but also as L2 broadcast. Apparently that helps on older machines that can't handle L2 unicast replies. ok jca@
* pledge(2) dhcrelay with "stdio route". route is needed for interface ioctls.reyk2016-12-071-1/+4
| | | | OK rzalamena@
* Rename function discover_interfaces into get_interface and change itsrzalamena2016-12-073-26/+27
| | | | | | prototype to be more useful. ok reyk@
* Exit early from rdaemon() is the passed fd is invalid.jca2016-09-261-1/+7
| | | | fd == -1 check suggested by deraadt@, ok florian@
* Go in the background later, using rdaemon().jca2016-09-151-6/+40
| | | | | | | | | | | | rdaemon() works like daemon(3) but requires its caller to pre-open /dev/null. This makes it possible to go in the background after a chroot(2), allowing for more error checking. The pattern is basically - open /dev/null - chroot - privdrop - rdaemon "design" initialy discussed with semarie@ a while ago, ok dlg@
* Avoid double negations in tests.jca2016-09-041-5/+7
| | | | ok krw@
* Pull in <time.h> for one or more of gmtime, strftime, strptime, time,guenther2016-08-272-2/+4
| | | | | | timegm, and tzset ok deraadt@
* Replace the /dev/bpf* open loop with a plain open("/dev/bpf0", ...).natano2016-05-281-21/+8
| | | | ok deraadt jca
* Eliminate #include inside *.h files and include only needed headers inkrw2016-02-076-47/+83
| | | | | | | each *.c file. Inspired by mention of header silliness by Edgar Pettijohn and mmcc@ on tech@.
* be very careful accepting packets via bpf. First check that thekrw2016-02-031-7/+28
| | | | | | | | | | | | | fixed part of the IP header is completely present before using its header length field. Then use the data in the IP header to ensure the entire IP packet is present. Then check that the entire UDP header is present. Then use the data in the UDP header to ensure all the data it thinks is present is actually present. Started when tj@ and a few others noticed ISC "DHCP CVE-2015-8605: UDP payload length not properly checked". ok sthen@ henning@
* Variables to count seen packets should be unsigned.sthen2016-02-021-10/+10
| | | | From dhcpd/packet.c r1.8 ok jca
* Nuke local #define ETHER_HEADER_SIZE and use the identical value'dsthen2016-02-021-6/+4
| | | | | | ETHER_HDR_LEN from if_ether.h. From dhcpd packet.c r1.6. ok jca
* Remove unused (a.k.a. always passed NULL) parameter 'data' fromsthen2016-02-023-27/+26
| | | | | | | | | decode_udp_ip_header() and the useless check of it. Part of original diff from pelikan about udp length errors. From dhcpd: bpf.c r1.9, dhcpd.h r1.46, packet.c r1.5 ok jca
* "Check UDP length for short as well as long values" - apply the fix fromsthen2016-01-131-2/+2
| | | | usr.sbin/dhcpd/packet.c r1.4 to dhcrelay. ok deraadt@
* Remove unnecessary netinet/in_systm.h include.lteo2014-10-252-4/+2
| | | | ok millert@
* merge dhcpd's packet.c revision 1.7:tobias2014-07-281-3/+4
| | | | | | | | Fix very hard to reach DoS attack vector, which would involve more than 8 billion network packets. Mixture of many many malformed and proper packets could result in a division by zero. ok krw@
* use .Mt for email addresses; from Jan Stary <hans at stare dot cz>; ok jmc@schwarze2013-07-161-4/+4
|
* typo in commentbenno2013-03-041-2/+2
| | | | ok deraadt
* VMware PXE "ROMs" confuse the DHCP gateway address with the IPdlg2013-01-151-1/+12
| | | | | | | | | | | | gateway address. This is a problem if your DHCP relay is running on something that's not your network gateway. It is purely informational from the relay to the client so we can safely clear it. stupid vmware. ok krw@ beck@
* last stage of rfc changes, using consistent Rs/Re blocks, and moving thejmc2012-09-261-3/+33
| | | | references into a STANDARDS section;
* 'ingnoring' -> 'ignoring' in a couple of note()'s.krw2012-06-221-3/+3
|
* Convert SO_RTABLE's protocol level to the SOL_SOCKET; ok claudiomikeb2011-06-211-3/+3
|