summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2019-01-16dhcpv6-ia: fix onlink IA check (FS#2060)Hans Dedecker
Some DHCPv6 clients start sending SOLICIT messages without including either an IA_NA or IA_PD and only start including an IA_NA or IA_PD in the REQUEST message without including an IA_PREFIX or IA_ADDR as suboption. As a result the check to verify if an IA_ADDR and/or IA_PREFIX is onlink fails. Fix this by returning notonlink if an IA_PREFIX or IA_ADDR suboption is present having an address/prefix not matching any of the addresses Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-01-15dhcpv6: add setting to choose IA_NA, IA_PD or bothMatija Amidzic
Adds the config options to set if DHCPv6 'stateful addresing' hands out IA_NA (Internet Address - Network Address), IA_PD (Internet Address - Prefix Delegation), both or none. Signed-off-by: Matija Amidzic <matija.amidzic@sartura.hr>
2019-01-02router: add syslog tracing for skipped routesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-01-02router: filter route information optionHans Dedecker
Commit 750e457e3000187b85906814a2529ede24775325 added the capability to filter out prefixes in RAs; however routes were not filtered out based on the prefixes. This commit fixes this by taking into account the prefix_filter when constructing the RA route info option Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-01-01router: make announcing DNS info configurable (FS#2020)Hans Dedecker
Make announcing options Recursive DNS server and DNS search list configurable via the ra_dns config option. This allows to disable sending RA based DNS info if such info is already provided by DHCPv6. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-12-31router: check return code of odhcpd_get_interface_dns_addr()Hans Dedecker
Check if odhcpd_get_interface_dns_addr() returns a valid DNS address. While at it restructure the DNS RA code to make it more readable Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-12-31config: check for invalid DNS addressesHans Dedecker
Don't accept 0.0.0.0 and :: as DNS addresses. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-12-12odhcpd: switch to libubox container_of implementationHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-12-12treewide: switch to libubox ARRAY_SIZE immplementationHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-11-27netlink: fix triggering of NETEV_ADDR6LIST_CHANGE eventHans Dedecker
Generate a NETEV_ADDR6LIST_CHANGE event in case the preferred lifetime makes a transition from deprecated (preferred lifetime not greater than current timestamp) to not deprecated (preferred lifetime greater than current timestamp) Reported-by: Tian Hao <haotia@gmail.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-11-23config: correctly break string for prefix filterHamster Tian
This if statement does the following: 1. Copy the value of "config prefix_filter" 2. Break the string at "/" 3. Save the number after / as prefix length 4. Convert the address before / into in6_addr However the extraneous "=" broke the second step and inet_pton failed with addresses with mask. This commit removes the = thus fixes the feature. Signed-off-by: Tian Hao <haotia@gmail.com>
2018-10-07odhcpd: make DHCPv6/RA/NDP support optionalHans Dedecker
In case IPv6 is not enabled don't try to init DHCPv6/RA and NDP but only init DHCPv4. This allows odhcpd to start up in absence of IPv6 support. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-09-23dhcpv6: check return code of dhcpv6_ia_init()Hans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-09-23router: don't leak RA message in relay mode (FS#1853)Hans Dedecker
In relay mode don't send RA message with router lifetime equal to 0 when interface gets disabled as router Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-09-05odhcpd: detect broken hostnamesHans Dedecker
Check hostnames contain valid characters as defined in RFC 952 and RFC 1123. Invalid hostnames in uci configured host entries will result into a refusal to create the static lease. In case a client received hostname contains an invalid character no <hostname> <IP address> entry will be added to the lease file. In such case the leaseinfo description in the lease file will still contain the hostname but preceded by the string broken\x20 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-09-03config: fix odhcpd_attrs array sizeHans Dedecker
Use ODHCPD_ATTR_MAX as array size of odhcpd_attrs Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-07-26ubus: avoid dumping interface state with NULL messageJo-Philipp Wich
Invoking ubus methods with NULL message is not supported anymore, so make sure that network.interface/dump is called with an empty blob buffer argument. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-09dhcpv4: improve error checking in handle_dhcpv4()Hans Dedecker
Check ioctl return value as reported by Coverity in CID1437659 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-07-05odhcpd: Check if open the ioctl socket failedHyeonsik Song
Signed-off-by: Hyeonsik Song <blogcin@naver.com>
2018-06-26dhcpv6-ia: fix border assignment size settingHans Dedecker
The border assignment size is not updated by address list change events if the interface is not configured as DHCPv6 server; therefore set the border assignment size when an interface is enabled and configured as a DHCPv6 server in order to keep the assignment size in sync with the available prefix sizes Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-26dhcpv6-ia: fix status code for not on link IAsHans Dedecker
Set status code not on link for IAs in DHCPv6 request messages carrying prefixes/addresses not matching the link prefix(es) to which the client is connected Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-22dhcpv6-ia: improve error checking in assign_pd()Hans Dedecker
Detected by Coverity in CID1412267 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-22config: fix wrong assignmentHans Dedecker
Detected by Coverity in CID1430899 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-22dhcpv4: delay forced renew transaction startHans Dedecker
Delay the start of the forced renew transaction start with a random delay between 500 and 1000 ms. This avoids sending DHCP forced renew messages in case the DHCP client starts sending discover messages triggered by link state flap. Also it distributes sending of DHCP forced renew messages to different clients over an interval instead of sending DHCP forced renew messages in a burst mode. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-21dhcpv4: fix DHCP address space logicHans Dedecker
Don't use an IPv4 address which belongs to the force renew IP address list as candidate for the DHCP address space calculation logic as such addresses are installed by the forced renew logic to safeguard IP connectivity during the forced renew message exchanges and thus cannot be used to calculate the DHCP address space Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-15dhcpv4: improve logging when sending DHCP messagesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-13odhcpd: call handle_error when socket error can be retrievedHans Dedecker
Detected by Coverity in CID1412300 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-07dhcpv6: fix out of bounds write in handle_nested_message()Hans Dedecker
Detected by Coverity in CID1412413 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-07dhcpv6-ia: log renew messages as wellHans Dedecker
As the odhcpd log verbosity is configurable log renew messages as well. Fixes logically dead code reported by Coverity in CID1412318 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-04router: fix possible segfault in send_router_advert()Hans Dedecker
Detected by Coverity in CID1412349 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-06-04odhcpd: fix passing possible negative parameterHans Dedecker
Prevent passing negative argument to read; detected by Coverity in CID1412381 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-28treewide: switch to C-code style commentsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-28router: improve error checkingHans Dedecker
Improve error checking fixing resource leak detected by Coverity in CID 1430880. Further fix unchecked return value reported by Coverity in CIDs 1430872, 1430839, 1430831 and 1412382 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-26netlink: fix incorrect sizeof argumentHans Dedecker
Fix incorrect sizeof arguments detetced by Coverity in CID 1430866 and CID 1430893 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-24dhcpv6: improve error checking in dhcpv6_setup_interface()Hans Dedecker
Improve error checking fixing resource leakage detected by Coverity in CID 1430880 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-21ubus: fix invalid ipv6-prefix jsonMislav Novakovic
"ipv6-prefix": [ { "<some ipv6 address>", "preferred-lifetime": 37979, "valid-lifetime": 48779, "prefix-length": 63 } ], json object is missing key, set address as key name. Line up DHCPv4 lease json info by using key name "address" Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-16ndp: improve error checkingHans Dedecker
Improve error checking; fixes resource leak detected by Coverity in CID 1430925 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-16dhcpv4: fix error checking in dhcpv4_setup_interface()Hans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-15dhcpv4: fix out of bound access in dhcpv4_putHans Dedecker
Detected by Coverity in CID 1433363 and 1432121 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-15dhcpv4: improve error checking in dhcpv4_setup_interface()Hans Dedecker
Improve error checking fixing resource leakage detected by Coverity in CID 1433402 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-05-03odhcpd: fix strncpy boundsHans Dedecker
Fix strncpy bounds as reported by Coverity in CID 1412278 and 1412293 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-04-23dhcpv6-ia: keep tentative assignments alive for a short timeHans Dedecker
Assign tentative assignments a lifetime of 60 seconds; this will assure the assignment is seen as valid during lookup when receiving a later REQUEST from the DHCPv6 client. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-04-23dhcpv6-ia: make assignment lookup more strictHans Dedecker
Whe doing an assignment lookup do a strict match between the assignment IAID and the IAID received form the client in case the BOUND or TENTATIVE assignment flags are set. This fixes a wrong assignment being returned for a client which uses a different IAID than the IAID used in a previous DHCPv6 exchange. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-04-18router: fix managed address configuration settingHans Dedecker
Don't announce managed address configuration in case DHCPv6 is disabled Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-04-09router: improve RFC7084 compliancyHans Dedecker
Send Router Information Option as well for prefixes with length 64 in order to be compliant with L-3 in RFC7084: An IPv6 CE router must advertise itself as a router for the delegated prefixes using the "Route Information Option". Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-02-20dhcpv6-ia: don't always send reconf accept option (FS#1377)Hans Dedecker
Send reconfigure accept and reconfigure key authentication protocol options only if the client indicates it supports reconfigure accept as descibed in RFC3315 paragraph 21.5. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-12-17odhcpd: Replace strerror(errno) with %m formatRosen Penev
Saves a few bytes. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2017-12-08Support muliple RAs on single interfacePierre Pfister
IETF is moving toward implementing IPv6 multihoming by sending multiple RAs on a single interface: - draft-ietf-intarea-provisioning-domains-00 - draft-ietf-rtgwg-enterprise-pa-multihoming-02 odhcpd supports configuration of multiple software interfaces on the same physical interface, which already advertises multiple RAs, but had two issues: - Each RA includes all the prefixes available on the interface. - Replies to sollicits with a single RA. This patch introduces the prefix_filter configuration parameter which allows filtering prefixes that are sent in a given RA, and fixes the sollicit code in order to reply with all the RAs that are configured on a given interface. Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2017-12-06dhcpv4: notify DHCP ACK and RELEASE via ubusHans Dedecker
If the ubus object has any subscription notify DHCP ACK and DHCP RELEASE events using ubus notifications. Signed-off-by: Borja Salazar <borja.salazar@fon.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-11-25dhcpv6: fix compile issues when CER-ID extension is enabledHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>