summaryrefslogtreecommitdiffhomepage
path: root/src/dhcpv4.c
AgeCommit message (Collapse)Author
2017-01-02dhcpv4: coding style fixesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-28dhcpv4: make dhcpv4_msg_to_string staticHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-28dhcpv4: fix DHCPv4 hostname handlingHans Dedecker
Fix hostname not being reported as "-" in the DHCP statefile in case no hostname is reported by the DHCPv4 client (https://:wqgithub.com/openwrt/odhcpd/issues/94) Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-27Limit lifetime of non-static leases in case of release and declineHans Dedecker
In case infinite leasetime is assigned to a non static DHCPv4/v6 lease override the infinite lifetime of the lease when either a DHCPv4/v6 decline or release is received. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-15Don't print non bound assignments in the state fileHans Dedecker
Set bound flag for DHCPv4 and DHCPv6 assignments when the IPv6/IPv4 address is leased to a client. This will prevent the printing of leases and hostname/IPv4/IPv6 address combinations in the state file for for which the IPv4/6 address has not been assigned. Also this will fix the printing of assignments which have been declined by the clients Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-11-21dhcpv4: Adding DHCP client leasetime request supportHans Dedecker
Add support for DHCPv4 clients proposing a leasetime; proposed leasetime will be accepted if it does not exceed either the pool or configured lease leastime. Further rework the duplicated leasetime logic which was in place. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-11-21dhcpv4: Keep DHCPv4 assignment lifetime value in sync with assigned leasetimeHans Dedecker
Keep the valid_until assignment parameter in sync with the leasetime assigned to the DHCP client when handling DHCP request message. This guarantees the contents of the ubus dhcp ipv4leases valid parameter is in sync with the client leasetime Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-11-21config: Support infinite as DHCP pool leasetime valueHans Dedecker
Add support for infinite leasetime value; this can be done by specifying "infinite" as leasetime value which is similar to dnsmasq infinite leasetime support. Specifying "infinite" as leasetime is valid for both the host and dhcp uci sections. A DHCPv4/DHCPv6 assignment is now considered infinite if valid_unil holds the value 0. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-05-19Add per-host leasetime supportSteven Barth
Patch by Daniel Dickinson Signed-off-by: Steven Barth <steven@midlink.org>
2015-08-20Revert "RFC: dhcpv4 support openwrt alias ip addr"Steven Barth
2015-06-22dhcpv4: add ifdef ubus for dhcp4 ipPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-19dhcpv4: add in_addr dhcpv4_mask and in_addr dhcpv4_addr to struct interfacePatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-18dhcpv4: fix unitialization of maskPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-18dhcpv4: fix char ubus_get_address4 int ubus_get_mask4 functionPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-15dhcpv4: use iface-namePatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-15dhcpv4: remove comment code linesPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-15dhcpv4: use ubus for ipv4 dhcp range calculationPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-05-11dhcpv4: remove invalid free()Steven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2015-04-14Fix potential invalid memory accessSteven Barth
2015-02-23DHCPv4: Compile fix on 64bit Debian.Markus Stenberg
2014-10-22dhcpv4_assign: rework the assignment logicChristian Mehlis
2014-10-21dhcpv4_assign: try 100 times to find a IPChristian Mehlis
This is what the comment on the loop is saying. Also change the srand comment to match to the actual code.
2014-08-23odhcpd: don't kill static lease entriesSteven Barth
2014-08-19dhcpv4: fix manual dhcp-rangesSteven Barth
2014-08-18dhcpv4: log reply in a more precise wayChristian Mehlis
2014-08-18dhcpv4: send NAK to broacast addressChristian Mehlis
2014-08-18dhcpv4: added more commentsChristian Mehlis
2014-08-12Merge pull request #22 from mehlis/log-dhcp4-eventssbyx
dhcpv4: log requests and replies to syslog
2014-08-12Merge pull request #21 from mehlis/fix-nak-by-doing-valid-replysbyx
dhcpv4: offer a valid configuration with DHCP NAK
2014-08-12dhcpv4: offer a valid configuration with DHCP NAKChristian Mehlis
On network change the client requests a non valid configuration. In this case we have to reply with a DHCP NAK. But this NAK can include a valid configuration like an ACK does. With this change iDevices and Androids can finish DHCP even with wrong configuration in first REQUEST with two packets and without any additional timeouts and round trips.
2014-08-12dhcpv4: implement router configuration optionChristian Mehlis
RFC 2132 defines: 3.5. Router Option The router option specifies a list of IP addresses for routers on the client's subnet. Routers SHOULD be listed in order of preference. The code for the router option is 3. The minimum length for the router option is 4 octets, and the length MUST always be a multiple of 4. Code Len Address 1 Address 2 +-----+-----+-----+-----+-----+-----+-----+-----+-- | 3 | n | a1 | a2 | a3 | a4 | a1 | a2 | ... +-----+-----+-----+-----+-----+-----+-----+-----+--
2014-08-12dhcpv4: log requests and replies to syslogChristian Mehlis
This change let odhcpd print dhcpv4 events to syslog.
2014-08-07sync hostfile more oftenSteven Barth
2014-07-01DHCPv6 destination address checkHans Dedecker
As described in RFC3315 §15 any solicit, confirm, rebind or information request message is discarded if the destination address is unicast Likewise any request (§18.2.1), renew (§18.2.3), release (§18.2.6) or decline (§18.2.7) message is discarded and the server replies with the status code use multicast.
2014-07-01DHCPv4: send DHCPNAK if requested addr != leased addrSteven Barth
2014-06-30Fixes compile error with muslSteven Barth
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-06-18Fix DHCPv4 static leases (thanks arnd)Steven Barth
2014-06-16add more consistency to host file writingSteven Barth
2014-06-16dhcpv4: update hostfile more oftenSteven Barth
2014-06-12dhcpv4: use search domain instead of domain optionSteven Barth
2014-06-10Fix DHCP settings for /28Steven Barth
2014-06-07Add default DHCPv4 range for prefixes down to /28Steven Barth
2014-05-30Make filtering customizableSteven Barth
2014-02-01Change homenet detection to User-ClassSteven Barth
2013-12-05Fix possible SEGFAULT conditionsHans Dedecker
2013-10-17ignore hnet internal routersSteven Barth
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
2013-10-16Minor fixesSteven Barth
2013-10-14Fix IP TOSSteven Barth
2013-10-14Various fixesSteven Barth
2013-10-14Initial commitSteven Barth