summaryrefslogtreecommitdiffhomepage
path: root/src/odhcpd.h
AgeCommit message (Collapse)Author
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-02-20router: allow RA prefix lifetime being set to leasetime value (FS#397)Hans Dedecker
Add config option ra_useleasetime which allows the RA prefix lifetime being set to the leasetime in case the valid and/or preferred prefix lifetime is bigger than the configured leasetime. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-16router: support ra_mininterval and ra_lifetime uci parameters (FS#397)Hans Dedecker
Add support for uci parameters ra_mininterval and ra_lifetime as described in RFC4861 paragraph 6.2.1. Variable ra_mininterval allows to configure the minimum interval time between unsolicited router advertisement messages; default value is 200 seconds. The minimum allowed value is 4 seconds while the maximum value is limited to 0.75 of the maximum interval time. The calculation of the maximum interval time between unsolicited router advertisement messages has been reworked. The default value is 600 seconds as specified in RFC4861; if the maximum interval time exceeds 0.33 * the minimal valid lifetime of all IPv6 prefixes it will be limited to 0.33 * the minimal valid lifetime of all IPv6 prefixes Variable ra_lifetime allows to configure the Router Lifetime field in the router advertisement messages; the value is either 0 or a value between the maximum interval time and 9000 seconds. If the router lifetime is smaller than the RA maximum interval it will be set equal to the RA maximum interval time. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-15Revert "odhcpd.h: fix alignment style"Hans Dedecker
This reverts commit 62ea54f5db4c636710781056541c4b85d043bef8.
2017-02-15odhcpd.h: fix alignment styleHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-14config: make loglevel configurable via uci (FS#481)Hans 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-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-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-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-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-21treewide: use RELAYD_MAX_ADDRS as address array sizeHans Dedecker
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-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-11-21config: Support infinite as DHCP pool leasetime valueHans Dedecker
Add support for infinite leasetime value; this can be done by specifying "infinite" as leasetime value which is similar to dnsmasq infinite leasetime support. Specifying "infinite" as leasetime is valid for both the host and dhcp uci sections. A DHCPv4/DHCPv6 assignment is now considered infinite if valid_unil holds the value 0. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-05-19Add per-host leasetime supportSteven Barth
Patch by Daniel Dickinson Signed-off-by: Steven Barth <steven@midlink.org>
2015-11-16Handle netlink ENOBUFS eventsSteven Barth
2015-08-20router/dhcpv6: use link-local addresses for DNSSteven Barth
2015-08-20Revert "RFC: dhcpv4 support openwrt alias ip addr"Steven Barth
2015-08-20Merge pull request #46 from stargieg/masterSteven Barth
RFC: dhcpv4 support openwrt alias ip addr
2015-07-14Remove unsolicited unicast RAs, adjust intervalsSteven Barth
2015-07-14ndp: fixup relaySteven Barth
2015-07-07router: also send RAs to every known neighborSteven Barth
2015-06-19dhcpv4: add in_addr dhcpv4_mask and in_addr dhcpv4_addr to struct interfacePatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-18dhcpv4: fix char ubus_get_address4 int ubus_get_mask4 functionPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-15dhcpv4: add ubus_get_address4 ubus_get_mask4 functionPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-04-10ra: always send current hop limitSteven Barth
2015-03-30properly handle return codesJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-03-30Readd missing ubus function definitionsSteven Barth
2015-03-29Remove prefix coloring support, refine hybrid management modeSteven 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-10-17ndp: more fixesSteven Barth
2014-10-16Begin rewrite of NDP-relaySteven Barth
2014-10-16router: add support for router addressSteven Barth
2014-08-12dhcpv4: implement router configuration optionChristian Mehlis
RFC 2132 defines: 3.5. Router Option The router option specifies a list of IP addresses for routers on the client's subnet. Routers SHOULD be listed in order of preference. The code for the router option is 3. The minimum length for the router option is 4 octets, and the length MUST always be a multiple of 4. Code Len Address 1 Address 2 +-----+-----+-----+-----+-----+-----+-----+-----+-- | 3 | n | a1 | a2 | a3 | a4 | a1 | a2 | ... +-----+-----+-----+-----+-----+-----+-----+-----+--
2014-07-22Revert "rewrite of NDP proxy" for nowSteven Barth
2014-07-16Initial rewrite of NDP proxySteven Barth
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-05-30Make filtering customizableSteven Barth
2014-05-29Move dhcpv6 raw attributes to correct placeSteven Barth
2014-05-25Add support for raw DHCPv6 attributesSteven Barth
2014-04-01Complete managed PD/CER-ID supportSteven Barth
2014-03-24Managed PD: initial supportSteven Barth
2014-02-21Fix wrong address pool being advertisedSteven Barth
2014-02-17Add support for (managed) prefixes of length 65-96Steven Barth
2014-01-04Use 1 socket per interface for DHCPv6Steven Barth
2014-01-03Remove ula_compat featureSteven Barth
2013-12-03Fix prefix class logicSteven Barth