summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2016-12-30dhcpv6-ia : code style fixesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-29config: use free_lease to delete a leaseHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-29config: coding style fixesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-29config: Create statefile dirHans Dedecker
Create statefile dir if the specified dir does not yet exist Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-28dhcpv6-ia: use free_dhcpv6_assignment where neededHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-28dhcpv6-ia: make free_dhcpv6_assignment staticHans Dedecker
Further align coding style 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-27Revert "Respect interface "ignore" settings as documented."Stijn Tintel
This reverts commit 5f425ed1e5f92397e27ec4f44820b6ef677b8134. Both dnsmasq and odhcpd use the ignore option. This is fine for normal operation, but it breaks DHCPv6 relay when dnsmasq is disabled on the wan interface. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2016-12-27router: skip parse_routes when ra_default > 1Stijn Tintel
It does not make sense to scan the entire routing table if the decision will be overridden afterwards. This makes it possible to use odhcpd on a router with full IPv6 BGP table, by setting ra_default to 2. Without this change, odhcpd is constantly busy reading /proc/net/ipv6_route, and doesn't respond to router solicitations in time. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
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-12-12config: Fix RA interface config being overwrittenHans Dedecker
In case multiple dhcp uci sections are configured and one section contains RA config while the other section does not; the RA interface config of the first section will be overwritten by the second section. Fix this by setting the default values for ra_management and ndp_proxy_routing uci parameters when the interface is created and by removing the overwrite check Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-01dhcpv6-ia : Fix static DHCPv6 assignments becoming non staticHans Dedecker
The valid_until parameter which is set to 0 for static DHCPv6 assignments was overwritten depending on the received DHCPv6 message which turned the assignment into having a finite lifetime and thus not static anymore. Fix this by checking if the valid_until parameter holds infinite lifetime before updating it. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-01dhcpv6-ia: Fix assignment of static DHCPv6 leasesHans Dedecker
Fix assignment of static DHCPv6 leases which was broken by commit 6c3bc0141dacc88992583d6f2cdc8a360df7422d. At the same time fix lifetime check of existing assignments having a finite lifetime Fixes FS#309 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-01cmake: Find libubox/uloop.hFlorian Fainelli
Add a CMake FIND_PATH and INCLUDE_DIRECTORIES searching for libubox/uloop.h. Some external toolchains which do not include standard locations would fail to find the header otherwise. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2016-12-01odhcpd: Display infinite valid lifetime as -1Hans Dedecker
Display infinite valid lifetime as -1 both in ubus and statefile Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-11-21Respect interface "ignore" settings as documented.Karl Palsson
The "ignore" option is correctly loaded. Actually observe it as documented. Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-11-21enable loglevel setting via command lineKarl Palsson
Currently the loglevel is hardcoded to LOG_WARNING, even though there is debug log messages. Allow setting the loglevel via cli option. Include basic help text because we're adding command line options. Signed-off-by: Karl Palsson <karlp@etactica.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-21dhcpv6-ia: Display infinite lifetime as INT32_MAX in state fileHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-11-21ubus: Fix displayed valid paramater for both DHCPv4 and DHCPv6 leaseHans Dedecker
Fix ubus valid parameter being displayed as a negative number; also display infinite lifetime as INT32_MAX 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-10-09Correct a typoMassimiliano Stucchi
2016-09-27odhcpd: remove superfluous log output.Karl Palsson
Drop pointless syslog. The single line just doubles the amount of lines logged to syslog without adding any value. Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-05-19Add per-host leasetime supportSteven Barth
Patch by Daniel Dickinson Signed-off-by: Steven Barth <steven@midlink.org>
2016-01-31Merge pull request #68 from dedeckeh/bugfixesSteven Barth
config: blobmsg_check_attr expects bool type as last argument
2015-12-15config: blobmsg_check_attr expects bool type as last argumentHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-11-29Merge pull request #67 from dedeckeh/bugfixesSteven Barth
Fix interface ifname overwrite in case UCI dhcp section contains ifname or networkid parameter
2015-11-27config: Prioritize ifname resolving via ubus over ifname/networkid attributesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-11-27config: Close interface when ifindex cannot be resolvedHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-11-17fall through in error case to clear congestionSteven Barth
2015-11-16Handle netlink ENOBUFS eventsSteven Barth
2015-10-21Merge pull request #63 from willmo/router-lifetimeSteven Barth
Clamp router lifetime per RFC 4861
2015-10-20Don't overflow router lifetimeWill Mortensen
When a prefix lifetime was greater than UINT16_MAX, we would advertise a shorter router lifetime (even potentially 0). Saturate instead.
2015-10-21Merge pull request #62 from willmo/dns-lifetimeSteven Barth
Correctly byteswap DNS lifetimes in RAs
2015-10-20Correctly byteswap DNS lifetimes in RAsWill Mortensen
2015-09-07dhcpv6: use correct length when copying duidSteven Barth
2015-09-07router: don't announce as default router if we aren'tSteven Barth
2015-09-07router: reduce dns lifetime to 10x maximum intervalSteven Barth
2015-09-07dhcpv6: fix mac-handlingSteven Barth
2015-09-01Fixup RAs/DHCPv6 announcing incorrect addressesSteven Barth
2015-08-20router/dhcpv6: use link-local addresses for DNSSteven Barth
2015-08-20router: improve deprecation handlingSteven Barth
2015-08-20Merge pull request #56 from sbyx/revert-46-masterSteven Barth
Revert "RFC: dhcpv4 support openwrt alias ip addr"
2015-08-20Revert "RFC: dhcpv4 support openwrt alias ip addr"Steven Barth
2015-08-20Merge pull request #54 from dedeckeh/bugfixesSteven Barth
Fixes compile issues and infinite lifetimes
2015-08-20Merge pull request #46 from stargieg/masterSteven Barth
RFC: dhcpv4 support openwrt alias ip addr
2015-08-13router: Fix infinite lifetimesHans Dedecker