summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2017-01-23treewide: rework prio of syslog messagesHans Dedecker
Rework prio of syslog messages allowing to filter out the relevant messages by setting the correct log level Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-23ndp: code cleanupHans Dedecker
ia_reconf is only set but nowhere used; so let's remove it ... Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-21router: add syslog debug tracing for trouble shootingHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-21treewide: use RELAYD_MAX_ADDRS as address array sizeHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-21ndp: don't scan netlink attributes in case of netlink route eventHans Dedecker
In case a netlink route event is received for a default route netlink data attributes were faulty processed as neigbor netlink data. Fix this by not processing any netlink attribute for any route event. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-06dhcpv6-ia: filter out prefixes having invalid lengthHans Dedecker
Function append_reply filters out addresses having invalid prefix length when constructing prefixes being delegated to a client. Now also filter out addresses with an invalid prefix length when writing the delegated prefixes in the statefile and during logging of the delegated prefixes. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-05dhcpv6-ia: fix dereference after freeing assignmentHans Dedecker
Fix assignment dereference by dhcpv6_log in case the assignment is freed when nothing has been assigned. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-05dhcpv6-ia: log only IPv6 addresses which are effectively assigned to a ↵Hans Dedecker
DHCPv6 client Fix displaying IPv6 addresses which were not assigned to a DHCPv6 client Clean up the code by using macro ADDR_ENTRY_VALID_IA_ADDR on different places to align the checks. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-05config: respect ignore uci optionJo-Philipp Wich
The odhcpd documentation currently implies that "option ignore 1" in a section of type "dhcp" will disable any services on the referenced interface while the code actually ignores the setting when initializing referenced interfaces. This commonly leads to situations where users think that "option disabled" will prevent any server activity on a given interface while in reality odhcpd effectively acts as rogue DHCPv6 server in its default configuration. To fully inhibit any activity, one has to specify both "option ignore 1" as well as "option ra disabled", "option ndp disabled" and "option dhcpv6 disabled" which is highly counter intuitive at best. A previous commit (5f425ed Respect interface "ignore" settings as documented.) attempted to address the problem by observing the value of i->ignore instead of unconditionally enabling all protocols but broke the ability to use DHCPv6 relay mode while having DHCPv4 disabled. This patch changes ... - the enabling of services on an interface to use the value of the ignore option as default choice instead of hardcoding "true" - the options "ra", "ndp", "dhcpv4" and "dhcpv6" to take precedence over the default "ignore" state to allow selectively enabling services on ignored interfaces - the README to clarify the fact that "ra", "ndp", "dhcpv4" and "dhcpv6" can now override "option ignore" Signed-off-by: Jo-Philipp Wich <jo@mein.io> Acked-by: Karl Palsson <karlp@etactica.com> Tested-by: Stijn Tintel <stijn@linux-ipv6.be> Tested-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-03dhcpv6-ia: fix static assignment checkHans Dedecker
Fix static assignment check failure which was introduced in commit 561890e Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-02dhcpv6-ia: coding style fixesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-02dhcpv6-ia: update valid_until only for non static DHCPv6 leasesHans Dedecker
Update valid_until lifetime only for non static DHCPv6 leases otherwise the lifetime of a static lease is not infinite anymore Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-02dhcpv4: coding style fixesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-31README: Add host leasetime uci parameterHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-30dhcpv6-ia: fix invalid IPv6/hostname entries in statefileHans Dedecker
Statefull IPv6 addresses are assigned to DHCPv6 clients from a local prefix based on criteria which need to be fulfilled. One of those criteria requires the IPv6 address still having preferred lifetime which was not checked when constructing the contents of the statefile. Another criteria requires the prefix length not being smaller than or equal to 64 when ra_management equals 0 or 1 which was neither correctly checked when constructing the statefile. This can lead to invalid hostname/IPv6 entries in the statefile and thus possible connectivity issues when using DNS resolving. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-30dhcpv6-ia: fix delete logic of an assignment in reconf_timerHans Dedecker
Function free_dhcpv6_assignment already removes the assignment in the list so there's no need to call list_del in reconf_timer Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
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