odhcpd: Replace strerror(errno) with %m format Saves a few bytes. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Support muliple RAs on single interface 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>
dhcpv4: make DHCPv4 support compiletime configurable Make DHCPv4 support compile time configurable; avoids DHCPv4 functionality overlap with other packages. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
treewide: rework handling of netlink events 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>
treewide: add netlink file 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>
treewide: align function naming Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
dhcpv4: force renew nonce authentication support 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>
ndp: detect ifindex changes via interface netlink events Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
treewide: replace RELAYD prefix naming in macros Remove the unfortunate RELAYD naming in the different macros Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
treewide: rework IPv4 address logic 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>
dhcpv6: assign all viable DHCPv6 addresses by default (FS#402, FS#524) 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>
treewide: reflect managed mode is related to RA 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>
treewide: rework logic to retrieve IPv6 interface addresses 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>
treewide: rework code to get rid of fixed IPv6 address arrays 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>
config: rework code to get rid of IFNAMSIZ usage Get rid of IFNAMSIZE usage for interface name and ifname variables Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
config: fix invalid hoplimit in RA message 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>
config: fix invalid retranstime in RA message 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>
config: fix invalid reachabletime in RA message 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>
config: limit ra_mtu to 65535 Limit the maximum ra_mtu to 65535 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
config: limit ra_retranstime to 60000 Limit the maximum ra_retranstime value to 60000 milliseconds as described in RFC7048. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>