summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
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>
2017-11-21ndp: add switch/case fallthrough commentsHans Dedecker
Fixes gcc 7 build errors Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-11-09dhcpv4: make DHCPv4 support compiletime configurableHans Dedecker
Make DHCPv4 support compile time configurable; avoids DHCPv4 functionality overlap with other packages. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-11-09treewide: rework handling of netlink eventsHans Dedecker
Rework the handling of netlink events by letting the different modules ndp, ra, dhcpv6 and dhcpv4 install netevent handlers. The installed netevent handlers are called by the netlink logic passing an event indication together with event data. Each netevent handler implements its own event logic; this makes the code more modular and less complex by moving all netlink code to netlink.c While at it rename ia_addr and ia_addr_len into addr6 and addr6_len respectively Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-10-16treewide: add netlink fileHans Dedecker
First step in moving netlink code to netlink.c by moving netlink code from odhcpd.c to netlink.c Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-10-13treewide: align function namingHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-13dhcpv4: fix memset compile issueHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-13dhcpv4: rework assignment lookupHans Dedecker
When receiving a DHCPv4 message use find_assignment_by_hwaddr to find an assignment as only one entry can be present in the assignment table for a given mac address. While at it pass requested address by the client as an uint32_t type to clean up the code. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-13dhcpv4: cleanup dhcpv4_test usageHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-13dhcpv4: rework lease expire handling logicHans Dedecker
Don't rely on incoming DHCPv4 messages to trigger the lease expire detection logic but rather use a periodic timer which checks every second if a lease is expired Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-13dhcpv4: force renew nonce authentication supportHans Dedecker
Support force renew nonce authentication support in the DHCPv4 server as described in RFC3203 and RFC6704. The interface uci arameter dhcpv4_forcereconf allows to supports DHCPv4 clients which support force renew without authentication. While at it align network byte order logic for simplicity. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-13dhcpv4: avoid segfault when there's no IPv4 prefixHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-13ndp: detect ifindex changes via interface netlink eventsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-11ubus: display accept reconf status for DHCPv6 assignmentsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-06treewide: replace RELAYD prefix naming in macrosHans Dedecker
Remove the unfortunate RELAYD naming in the different macros Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-08-17dhcpv4: fix possible segfault when lease is not createdHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-08-17dhcpv4: dhcpv4: move interface lease list insertion out of dhcpv4_assignHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-08-16ndp: use IPv4 address list when comparing IPv4 addressesHans Dedecker
Use IPv4 address list in check_addr_updates which fixes possible segfault as IPv6 address list was used by mistake. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-08-10dhcpv6-ia: rework reconfigure accept logicHans Dedecker
Rework reconfigure accept retransmission logic; every DHCPv6 assignment has its own reconfigure accept timer now making sure the timeout and retransmission behavior is in line with RFC3315 paragraph 19.1.2. While at it rename the original reconf_timer into valid_until_timeout as it will only check now the lifetime of the assignments. Set reconf_cnt to INT_MAX for every assignment which belongs to the same client identifier; before the reconf_cnt of the first handled assignment was set by mistake breaking the retransmission logic. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-08-07treewide: rework IPv4 address logicHans Dedecker
Align IPv4 address logic with IPv6 by caching per interface the assigned IPv4 addresses. This allows to get rid of different ioctl calls in the DHCPv4 logic to retrieve the IPv4 address and netmask in use by an interface. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-08-03dhcpv6: assign all viable DHCPv6 addresses by default (FS#402, FS#524)Hans Dedecker
Some client implementations expect DHCPv6 addresses to be assigned for every prefix present in a RA as reported in FS#524; if not done the client implementations spam the DHCPv6 server with SOLICIT messages trying to get an DHCPv6 address for every prefix. When ra_managed is set to 1 and an ULA prefix is configured; the DHCPv6 server will only assign an ULA DHCPv6 addresses which possibly leads to DNS issues. Fix these problems by providing dhcpv6_assignall config option which assigns all viable DHCPv6 addresses to a client by default. This is a trade off as it means client implementations will be assigned more IPv6 addresses and lose the ability to quickly renumber clients which don't support reconfigure accept in case of wan prefix change Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-08-02treewide: reflect managed mode is related to RAHans Dedecker
Improve code readability by renaming managed into ra_managed and define the according ra_managed flags. This will help to better understand the ra_managed logic as defined in the README file. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-07-04ndp: optimize check_addr6_updates codeHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-07-04ndp: fix syslog tracing for netlink neigbor and address eventsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-07-03treewide: rework logic to retrieve IPv6 interface addressesHans Dedecker
Retrieve IPv6 interface addresses when the interface gets created; this allows to get rid of the IPv6 address dump logic in ndp.c. Add IPv4 address support in odhcp_ipaddr struct. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-06-29router: use enum to specify order and index of iov structHans Dedecker
Improve code maintainability by using enum to order and index iov struct Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-06-29treewide: rework code to get rid of fixed IPv6 address arraysHans Dedecker
Rework code to get rid of RELAYD_MAX_PREFIXES and RELAYD_MAX_ADDRS by using dynamic IPv6 address array allocation. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-06-27config: rework code to get rid of IFNAMSIZ usageHans Dedecker
Get rid of IFNAMSIZE usage for interface name and ifname variables Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-06-27treewide: use angle-brackets to include libubox header filesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-05-15config: fix invalid hoplimit in RA messageHans Dedecker
Don't send an invalid hoplimit in RA message when the interface is shutdown due to a invalid configured ra_hoplimit. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-05-15config: fix invalid retranstime in RA messageHans Dedecker
Don't send an invalid retranstime in RA message when the interface is shutdown due to a invalid configured ra_retranstime. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-05-15config: fix invalid reachabletime in RA messageHans Dedecker
Don't send an invalid reachabletime in RA message when the interface is shutdown due to a invalid configured ra_reachabletime. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-05-15config: limit ra_mtu to 65535Hans Dedecker
Limit the maximum ra_mtu to 65535 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-05-15router: fix interface mtu read errorHans Dedecker
Use integer type for mtu variable as odhcpd_get_interface_config returns -1 when it fails to read the interface mtu. This allows to set the mtu to a meaningfull value of 1280 in case of interface mtu read failure. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-05-15config: limit ra_retranstime to 60000Hans Dedecker
Limit the maximum ra_retranstime value to 60000 milliseconds as described in RFC7048. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-05-12dhcpv4: display two hex digits per octet in syslogLeon M. George
Signed-off-by: Leon M. George <leon@georgemail.eu>