summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcrelay/dhcrelay.c (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@
* Don't stop logging to stderr when running in foreground with -d.reyk2017-07-051-4/+3
| | | | Pointed out by Kapetanakis Giannis
* constify pc_remote and pc_circuitreyk2017-04-041-3/+3
| | | | OK rzalamena@
* Move the server struct to header file and make it compatible with IPv6.rzalamena2017-03-161-16/+12
| | | | ok reyk@
* Improve the interface and addresses discovery code and prepare torzalamena2017-03-151-4/+10
| | | | | | receive IPv6 support. ok reyk@
* Remove some global variables that are not being used.rzalamena2017-03-141-17/+7
| | | | ok gsoares@, jca@
* Eliminate pointless'%m' (a.k.a. hand rolled strerror()) by using fatal() andkrw2017-02-131-18/+17
| | | | log_warn(). Zap a couple of explicit 'syslog()' calls.
* Adjust some long lines.krw2017-02-131-3/+4
|
* Switch from old errwarn.c logging to shiny new log.[ch].krw2017-02-131-52/+53
| | | | ok benno@
* Add dhcrelay(8) command-line option for replacing Relay Agent Informationrzalamena2016-12-161-5/+13
| | | | | | | 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-131-2/+2
|
* Implement support for layer 2 relaying and add further Relay Agentrzalamena2016-12-121-84/+396
| | | | | | | 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-081-20/+26
| | | | | | | | 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-081-1/+6
| | | | | | | 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-071-9/+4
| | | | | | 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-271-1/+2
| | | | | | timegm, and tzset ok deraadt@
* Eliminate #include inside *.h files and include only needed headers inkrw2016-02-071-2/+20
| | | | | | | each *.c file. Inspired by mention of header silliness by Edgar Pettijohn and mmcc@ on tech@.
* 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@
* '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
|
* Fix the naming of interfaces and variables for rdomains and rtablesguenther2010-07-031-4/+4
| | | | | | | | | | | | and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
* Pick up the rdomain from the specified interface and use that rdomain forclaudio2009-11-031-3/+31
| | | | | | relaying the packets to the server. If you need to use cross-domain forwarding us pf to bounce the packets back and forth. sure deraadt@
* Add support for "DHCP-over-IPsec" by implementing RFC 3046 (DHCP Relayreyk2009-09-031-4/+143
| | | | | | | | | | Agent Information Option) and RFC 3456 (DHCP Configuration of IPsec Tunnel Mode). This allows to configure various IPsec clients dynamically via DHCP; dhcrelay needs to listen on enc0 and forward requests to a DHCP server that supports RFC 3046, like I recently did for dhcpd(8). ok krw@
* missing new-line character.sobrado2008-07-091-2/+2
|
* documentation tweaks.sobrado2008-07-091-3/+3
|
* return on ECONNREFUSED so we don't fall through to 'result <stevesk2007-02-091-1/+4
| | | | | | BOOTP_MIN_LEN' and display discarding message. ok henning@ claudio@
* warn() -> warning() to not overload with libc function; this hasstevesk2006-12-181-3/+3
| | | | previously been done to dhclient and dhcpd
* no "\n" needed here; ok henning@stevesk2006-11-211-2/+2
|
* pretty up print_hw_addr(), and even fix a teeny buffer overflow; ok ottoderaadt2005-11-131-24/+19
|
* -endpwenthenning2005-05-231-2/+1
|
* more setres[ug]id; ok deraadt@djm2005-05-021-3/+3
|
* Fixed a typo.norby2005-01-251-2/+2
| | | | ok henning@ claudio@
* Use a udp socket to communicate with the dhcp servers. The bpf interfaceclaudio2004-10-121-5/+73
| | | | | | can't be used to forward the packets. Bpf would relay the packets to wrong interface. Reports and tests by Hans Kremers and Colin Harford OK henning@
* -p and -q are no morejaredy2004-08-151-2/+2
| | | | ok deraadt
* tzsethenning2004-05-121-1/+3
|
* remove unused stuff; henning okderaadt2004-05-041-3/+1
|
* fix _dhcp use nonexistant error message here toohenning2004-04-211-2/+2
|
* get rid of the -p switch, use fixed values for server and client ports,canacar2004-04-201-21/+10
| | | | | rename port variables for clarity. ok henning@
* more shrinking; ok henningderaadt2004-04-201-3/+3
|