summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2017-02-13odhcpd: display correct default log level in usage textHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-10treewide: define and use macro IN6_IS_ADDR_ULAHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-10ndp: deregister netlink event socket for non recoverable errorsHans Dedecker
Deregister netlink event socket in case of error different from ENOBUFS or failure to set netlink rx buffer size Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-10odhcpd: fix white space errorsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-09ndp: harden netlink event socket error handlingHans Dedecker
Start with a netlink receive buffersize of 130k for the netlink event socket; double the netlink receive buffer size in case an ENOBUFS is reported. Also align function naming and its parameters. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-09ndp: close proc file descriptor also during error handlingHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-09npd: rework IPv6 relay logic (FS#396)Hans Dedecker
Rework the IPv6 relay logic to make it more robust by making use of libnltiny to process netlink messages. At the same time reimplement the IPv6 relay finite state machine to make the relay logic less error prone Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-09config: restore interface defaults when cleaning interfaceHans Dedecker
Interface defaults are whiped when clean interface is executed resulting into loss of default behavior for the ndproxy_routing and ra_management uci parameters Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-01dhcpv6-ia: apply lease delete based on assignment bound stateHans Dedecker
Make adding and removing of routes via apply_lease dependant on the assignment bound state as it makes no sense to delete routes for an assignment which is not bound. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-31odhcpd: properly handle netlink messages (FS#388)Hans Dedecker
Use libnl-tiny to construct and process netlink messages when manipulating IPv6 routes and fetching IPv6 addresses. This fixes lingering netlink error messages on the netlink socket in case route deletion failed causing fetching of IPv6 addresses to be aborted and odhcpd faultly assuming no IPv6 addresses being present on the interface.
2017-01-31odhcpd: fix coding styleHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-26odhcpd: decrease default log level to LOG_INFOHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-26odhcpd: rework IPv6 interface address dumpHans Dedecker
Rework the IPv6 address dump logic to make it more robust and generate syslog traces in case of error situations Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-26odhcpd: extra syslog tracingHans Dedecker
Add extra syslog tracing for trouble shooting and make some syslog traces more self explaining Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-24router: fix compile issue on 64 bit systemsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-24Revert "router: fix compile issue on 64 targets"Hans Dedecker
This reverts commit 70fbf936839e02d526929be06ecba3059f78be3c.
2017-01-24router: fix compile issue on 64 targetsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-23router: convert syslog lifetime traces into LOG_INFO prioHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
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>