summaryrefslogtreecommitdiffhomepage
path: root/src/router.c
AgeCommit message (Collapse)Author
2017-05-11config: make RA mtu configurable via UCIHans Dedecker
Allow to specify the router advertisement mtu via the uci parameter ra_mtu. In case the config parameter is not set the MTU is taken from the interface as before. 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-02-21router: don't announce prefixes with valid lifetime equal to 0Hans Dedecker
Don't set prefix valid lifetime to 0 in case the preferred lifetime equals 0 and valid lifetime gets smaller than 7200. In corner cases it leads to router lifetime being set although no prefixes are announced with a valid lifetime different from 0. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-02-20router: fix arithmetic exception faultHans Dedecker
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-10treewide: define and use macro IN6_IS_ADDR_ULAHans Dedecker
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-26odhcpd: extra syslog tracingHans Dedecker
Add extra syslog tracing for trouble shooting and make some syslog traces more self explaining Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-24router: fix compile issue on 64 bit systemsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-24Revert "router: fix compile issue on 64 targets"Hans Dedecker
This reverts commit 70fbf936839e02d526929be06ecba3059f78be3c.
2017-01-24router: fix compile issue on 64 targetsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-23router: convert syslog lifetime traces into LOG_INFO prioHans Dedecker
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>
2017-01-21treewide: use RELAYD_MAX_ADDRS as address array sizeHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-27router: skip parse_routes when ra_default > 1Stijn Tintel
It does not make sense to scan the entire routing table if the decision will be overridden afterwards. This makes it possible to use odhcpd on a router with full IPv6 BGP table, by setting ra_default to 2. Without this change, odhcpd is constantly busy reading /proc/net/ipv6_route, and doesn't respond to router solicitations in time. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2015-11-27config: Close interface when ifindex cannot be resolvedHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-11-16Handle netlink ENOBUFS eventsSteven Barth
2015-10-20Don't overflow router lifetimeWill Mortensen
When a prefix lifetime was greater than UINT16_MAX, we would advertise a shorter router lifetime (even potentially 0). Saturate instead.
2015-10-20Correctly byteswap DNS lifetimes in RAsWill Mortensen
2015-09-07router: don't announce as default router if we aren'tSteven Barth
2015-09-07router: reduce dns lifetime to 10x maximum intervalSteven Barth
2015-09-01Fixup RAs/DHCPv6 announcing incorrect addressesSteven Barth
2015-08-20router/dhcpv6: use link-local addresses for DNSSteven Barth
2015-08-20router: improve deprecation handlingSteven Barth
2015-08-13router: Fix infinite lifetimesHans Dedecker
2015-08-13router: Fix compile issuesHans Dedecker
Fix compile issue due to comparison between signed and unsigned integers
2015-07-27ra/dhcpv6: unify address change handlingSteven Barth
2015-07-24Fix RA lifetimesSteven Barth
2015-07-15router: unify RA router and DNS lifetimeSteven Barth
2015-07-15router: fixup RA lifetime calculationSteven Barth
2015-07-14router: fix invalid router lifetimeSteven Barth
2015-07-14router: fix logic inversionSteven Barth
2015-07-14Remove unsolicited unicast RAs, adjust intervalsSteven Barth
2015-07-13router: only send RAs to neighbors if unsolicitedSteven Barth
2015-07-13router: only send direct RAs to link-local addressesSteven Barth
2015-07-07router: also send RAs to every known neighborSteven Barth
2015-04-10ra: always send current hop limitSteven 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-16router: add support for router addressSteven Barth
2014-10-16router: unicast RAs to RS senders by defaultSteven Barth
2014-08-07ra: don't send MSR for /64 prefix if DP is /64 as wellSteven 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-03-20Don't segfault when there is no IPv6 supportSteven Barth
2014-02-24Don't announce :: as DNSSteven Barth
2014-02-24Fix DNS-server and routes announced in RA for certain prefix casesSteven Barth
2014-02-21Fix wrong address pool being advertisedSteven Barth
2014-02-18Avoid some bloatSteven Barth