summaryrefslogtreecommitdiffhomepage
path: root/src/dhcpv6.c
AgeCommit message (Collapse)Author
2020-11-01dhcpv6: fix size_t fields in syslog formatMikael Magnusson
Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
2020-10-31dhcpv6: add explicit dhcpv4o6 server addressMikael Magnusson
Include the All_DHCP_Relay_Agents_and_Servers multicast address in the option explicitly. It shouldn't be needed according to RFC 7341 section 7.2 but ISC dhclient logs an error otherwise: dhcp4-o-dhcp6-server: expecting at least 16 bytes; got 0 Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
2020-10-31dhcpv6: add DHCPv4-over-DHCPv6 supportMikael Magnusson
Add support for DHCPv4-over-DHCPv6 (DHCP 4o6) Transport (RFC 7341). Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2020-10-29dhcpv6: check message typeMikael Magnusson
Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
2019-12-15treewide: optimize syslog priority valuesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-05-15config: remove 'ignore' config optionbpDainis Jonitis
1. Remove 'ignore' config option for interface. Interface is still used if any of 'ra', 'ndp', 'dhcpv4' or 'dhcpv6' options are different from default 'disabled' mode. In config_parse_interface() update runtime ignore value according to all mode values. 2. Reset ignore, ra, ndp, dhcpv4 and dhcpv6 values in set_interface_defaults(). Otherwise if option is deleted from config file and config is reloaded, it will use the value from old config, potentiallly not turning services off. 3. Do not use implicit checks that 0 server mode means MODE_DISABLED. 4. Simplify code of all service setup functions if passed enabled = true argument, but service mode is disabled. Signed-off-by: Dainis Jonitis <dainis.jonitis@ubnt.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-04-04treewide: initialize properly file descriptorsHans Dedecker
Initialzie properly the dhcpv6, dhcpv4 and ndp ffile descriptors when creating an interface. As such the check for a valid descriptor can be done correct now in the different modules Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-03-21dhcpv6: extra syslog tracingHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-03-21dhcpv6/router: add support for mutiple master interfacesHans Dedecker
Support multiple master interfaces for dhcpv6 and ra; it allows to forward dhcpv6 mesaages and RS on multiple upstream links Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-02-13dhcpv6: rapid commit supportHans Dedecker
Add support for rapid commit according to RFC8415 18.3.1 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-02-13dhcpv6: fix parsing of DHCPv6 relay messagesHans Dedecker
Commit 0db69b0b85c83fedd74ac77e850669a17c4e6617 broke parsing of DHCPv6 relay messages as the DHCPv6 client header pointer was not updated after parsing the nested relay forward message(s). Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-02-11dhcpv6-ia: move function definitions to odhcpd.hHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-02-11dhcpv6: improve code readibilityHans Dedecker
Use struct dhcpv6_client_header hdr to access fixed DHCPv6 header fields Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-02-03treewide: align syslog tracingHans Dedecker
Use the logical OpenWrt interface name in syslog printing as multiple logical interfaces can be defined on top of the same device 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-09-23dhcpv6: check return code of dhcpv6_ia_init()Hans Dedecker
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-05-28treewide: switch to C-code style commentsHans Dedecker
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>
2017-12-17odhcpd: Replace strerror(errno) with %m formatRosen Penev
Saves a few bytes. Signed-off-by: Rosen Penev <rosenp@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-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-13treewide: align function namingHans 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-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-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-03-30rework IPv6 dns address selection (FS#635)Hans Dedecker
Don't return anymore the link local IPv6 address as DNS IPv6 address since different OS implementations (e.g. android, ...) cannot handle a link local IPv6 address as DNS address. IPv6 DNS address selection is reworked as follows : -Consider all global/ULA IPv6 address having a valid lifetime -Give preference to global/ULA IPv6 addresses being not deprecated -Give preference to ULA IPv6 addresses over IPv6 global addresses -Give preference to the IPv6 address with the longest preferred lifetime in its selected category (ULA or global) -If no global/ULA IPv6 address is present use the IPv6 link local address Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-03-29rework IPv6 address dump logicHans Dedecker
Make the code more logical by moving the IPv6 address dump logic into the different protocol interface enable handlers so it's clear which protocols require interface IPv6 address tracking. At the same time restructure the IPv6 address dump logic so less IPv6 address netlink dumps are created. 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>
2015-08-20router/dhcpv6: use link-local addresses for DNSSteven Barth
2015-07-17dhcpv6: fix socket generation on relay masterSteven Barth
2015-07-17dhcpv6: send relay-forward messages using correct socketSteven Barth
2014-10-30Fix IPv6 DNS server adddress selectionHans Dedecker
Fix selection of IPv6 DNS address in DHCPv6 and RA overwrite as an address could be selected with preferred lifetime zero while IPv6 addresses are in use with non zero preferred lifetimes. Fix tries to pick the IPv6 address with the longest preferred lifetime now. Fixes also the issue an IPv6 address with preferred lifetime zero could be returned in DHCPv6 DNS server option while an IPv6 address with non zero preferred lifetime is returned as DNS recursive RA option for the same set of available IPv6 addresses.
2014-07-01Replace option sol_max_rt by inf_max_rt in reply response to information requestHans Dedecker
2014-07-01DHCPv6 destination address checkHans Dedecker
As described in RFC3315 §15 any solicit, confirm, rebind or information request message is discarded if the destination address is unicast Likewise any request (§18.2.1), renew (§18.2.3), release (§18.2.6) or decline (§18.2.7) message is discarded and the server replies with the status code use multicast.
2014-06-09Fix DHCPv6 relay reply message in case raw DHCPv6 attributes are presentHans Dedecker
Use enum to index iov struct
2014-05-30Make filtering customizableSteven Barth
2014-05-25Add support for raw DHCPv6 attributesSteven Barth
2014-04-23Don't return a DHCPv6 reply in response to a confirm without address(es)Hans Dedecker
RFC3315 Section 18.2.2 states no reply must returned by the server in case no address(es) are present : If the server is unable to perform this test (for example, the server does not have information about prefixes on the link to which the client is connected), or there were no addresses in any of the IAs sent by the client, the server MUST NOT send a reply to the client.
2014-04-01Complete managed PD/CER-ID supportSteven Barth
2014-03-24Managed PD: initial supportSteven Barth
2014-02-05Fix homenet filterSteven Barth
2014-01-09Fix ALL_DHCPV6_RELAYS/ALL_DHCPV6_SERVERS membership subscriptionHans Dedecker
2014-01-04Use 1 socket per interface for DHCPv6Steven Barth
2013-12-05Fix possible SEGFAULT conditionsHans Dedecker
2013-10-14Initial commitSteven Barth