summaryrefslogtreecommitdiff
path: root/sys/netinet6/nd6_rtr.c
AgeCommit message (Collapse)Author
2017-03-06Prefix functions dealing with routing messages with 'rtm_' and keepMartin Pieuchot
them all in net/rtsock.c. This allows to easily spot which functions are doing a copyout(9) when dealing with the routing midlayer. ok phessler@, bluhm@, dhill@, krw@, claudio@
2017-03-03Iterate over the global list of interfaces instead of using the globalMartin Pieuchot
list of IPv6 addresses. ok bluhm@
2017-02-09percpu counters for raw ipv6 and icmp6 statsJeremie Courreges-Anglas
ok mpi@
2016-12-22Remove all splsoftnet() from ND6 converting the non-recrusive ones toMartin Pieuchot
NET_LOCK(). ok bluhm@
2016-11-28Explicitly initialize rti_ifa when automagically adding a route.Martin Pieuchot
This will allow to strengthen checks when userland adds a route. ok phessler@, bluhm@
2016-11-28Remove multiple recursive splsoftnet().Martin Pieuchot
ok bluhm@
2016-11-21Assert that defrtrlist_update() is always called at IPL_SOFTNET.Martin Pieuchot
2016-11-21Assert that prelist_update() is always called at IPL_SOFTNET.Martin Pieuchot
While here use __func__ in debug strings to reduce noise when grepping.
2016-11-21Assert that in6_ifadd() is always called at IPL_SOFTNET.Martin Pieuchot
While here us __func__ in debug strings to reduce noise when grepping.
2016-10-03Convert some of the remaining usages of time_second to time_uptime.Martin Pieuchot
time_second is unix time so it can be affected by clock changes. time_uptime is monotonic so it isnt affected by clock changes. that in turn means route expiries wont jump with clock changes if set against time_uptime. the expiry is translated into unix time for export to userland though. Should fix mismatch between route timers that were already converted and ND default routers that were still using time_second. Tested by matthieu@ and sthen@ ok sthen@, dlg@
2016-09-30Revert sending router solicitations when a prefix expires and go backFlorian Obser
to previous behaviour of starting quick, exponentially backing off and settling on every 60 seconds. sthen@ noticed that this broke the backing off when we don't receive an advertisment and so we would hammer the network every second which is particularly bad on wifi networks. OK sthen@
2016-09-26typo in commentStuart Henderson
2016-09-08If the same address is offered via NA, update the existing ``ifa''Martin Pieuchot
instead of creating a new one. Having two addresses mean that the old, deprecated one, would be selected instead of the new one. The issue could be triggered by reducing the pltime/vltime values sent by a router advertisement daemon. Problem reported and fix tested by Jens Sauer on bugs@
2016-09-02Consider when a prefix expires when sending solicitations instead ofFlorian Obser
blindly always sending one every 60 seconds. repeated prodding & input naddy input & OK vgross
2016-09-02Go through the set function like normal people; no functional change.Florian Obser
OK benno@
2016-08-25Remove a check to expire received prefix.Martin Pieuchot
This check does not make sense since November 2000 when IPv6 autoconf address deletion has been made independent from prefix lifetimes. Fix a case when a route was added to the table but the corresponding address was not, leaving v6 unusable. Found the hardway by and ok sthen@
2016-08-22Sizes for free(9) from David Hill.Martin Pieuchot
2016-07-05Expand IN6_IFF_NOTREADY, ok bluhm@Martin Pieuchot
2016-05-02Simplify life for routing table implementations by requiring that rtable_walkJonathan Matthew
callbacks return EAGAIN if they modify the routing table. While we're here, simplify life for rtable_walk callers by moving the loop that restarts the walk on EAGAIN into rtable_walk itself. Flushing cloned routes on interface state changes becomes a bit more inefficient, but this can be improved later. ok mpi@ dlg@
2016-01-12Prevent a possible NULL-derefenced introduced by the move of RA sleepingMartin Pieuchot
code in a task. Such dereferenced can be triggered by receiving a RA with the 'on-link' bit set to 0 apparently generated by dnsmasq and reported by matthieu@. ok matthieu@, sthen@, bluhm@
2015-12-18Convert arc4random() to arc4random_uniorm(). Diff by Matthew Martin.tb
Ensure that arc4random_uniform() doesn't loop by redefining ND6_MAX_DESYNC_FACTOR to be 512, the largest power of two smaller than the RFC-specified 600 seconds. Suggested by florian@ and deraadt@ ok florian@, sthen@ in this form, arc4random change ok djm@, tedu@
2015-12-03Get rid of rt_mask() and stop allocating a "struct sockaddr" for everyMartin Pieuchot
route entry in ART. rt_plen() now represents the prefix length of a route entry and should be used instead. For now use a "struct sockaddr_in6" to represent the mask when needed, this should be then replaced by the prefix length and RTA_NETMASK only used for compatibility with userland. ok claudio@
2015-12-01Use rt_ifa_add(9) instead or rtrequest(9) when adding ND prefixes.Martin Pieuchot
While here pick the corresponding ``ifa'' to attach the route instead of the one corresponding to the link-local address on the same interface. ok bluhm@
2015-11-24No need for <net/if_types.h>Martin Pieuchot
As a bonus this removes a "#if NCARP > 0", say yeah!
2015-11-02typo in commentStuart Henderson
2015-11-02Prefer an existing refcounted ``ifp'' to rt_ifp when possible or use theMartin Pieuchot
interface index directly. ok bluhm@
2015-10-30Rename rtrequest1() to rtrequest().Alexander Bluhm
OK mpi@
2015-10-28Remove linkmtu and maxmtu from struct nd_ifinfo. IN6_LINKMTU can nowFlorian Obser
die and ifp->if_mtu is the one true mtu. Suggested by and OK mpi@
2015-10-25Put some comments in how nd6_rs_attach() works.Florian Obser
Requested by stsp
2015-10-25Introduce if_rtrequest() the successor of ifa_rtrequest().Martin Pieuchot
L2 resolution depends on the protocol (encoded in the route entry) and an ``ifp''. Not having to care about an ``ifa'' makes our life easier in our MP effort. Fewer dependencies between data structures implies fewer headaches. Discussed with bluhm@, ok claudio@
2015-10-24Ignore Router Advertisment's current hop limit.Martin Pieuchot
Appart from the usual inet6 axe murdering exercise to keep you fit, this allows us to get rid of a lot of layer violation due to the use of per- ifp variables to store the current hop limit. Imputs from bluhm@, ok phessler@, florian@, bluhm@
2015-10-22Inspired by satosin(), use inline functions to convert sockaddr dl.Alexander Bluhm
Instead of casts they check wether the incoming object has the expected type. So introduce satosdl() and sdltosa() in the kernel. OK mpi@
2015-09-18Do not manually decrement rt's refcounter in nd6_lookup() and let theMartin Pieuchot
callers rtfree(9) it. Inputs and ok bluhm@
2015-09-12Now that rtrequest1(9) properly sets RTF_UP for newly added route,Martin Pieuchot
stop passing it in every rt_ifa_add(9) calls. ok claudio@
2015-09-11Kill yet another argument to functions in IPv6. This time ip6_output'sClaudio Jeker
ifpp - XXX: just for statistics ifpp is always NULL in all callers so that statistic confirms ifpp is dying OK mpi@
2015-09-10if_put dance, shuffle some code and switch a printf to print the ifindexClaudio Jeker
instead of the name so we don't have to if_get/if_put it for just that. OK dlg@
2015-09-09Kill icmp6_ifstat_inc() and associated per-ifp storage.Martin Pieuchot
The SIOCGIFSTAT_ICMP6 is no longer supported. ok dlg@, mikeb@, claudio@
2015-08-24nd6_prefix_add() is no longer used and die.Martin Pieuchot
2015-08-24Start moving away from the global prefix list by limiting its usage toMartin Pieuchot
AUTOCONF'd addresses. This prevent the kernel from removing connected (/64) routes as soon as it configures an AUTOCONF'd address based on a RA. Tested by sebastia@, ok sthen@
2015-08-24Always increment the reference counter of the returned route entry inMartin Pieuchot
rtrequest1(9). This simplifies rtfree(9) dances and will prevent another CPU to free the entry before we're done with it as soon as routing functions can be executed in parallel. ok bluhm@, mikeb@
2015-08-24Rework the code to decide when to perform DAD to no longer rely on theMartin Pieuchot
IN6_IFF_NODAD pseudo-flag not being set. This was just a flag for spaghetti code that should not exist in the first place. Tested by sebastia@, ok sthen@
2015-08-19Convert all calls to rtrequest1() and the following error checkAlexander Bluhm
into a common pattern. In the man page clarify the usage of the returned route. OK mpi@ mikeb@ jmc@
2015-08-18Call rtfree(9) when we no longer need the route entry rather thanMartin Pieuchot
decrementing rt_refcnt just after rtrequest1(9). While here reduce the differences with rt_ifa_add(9). There's still an ambiguity about rtrequest1(9)'s return value, but bluhm@ will address that in a different diff. Discussed with and ok bluhm@
2015-08-17Remove anoying comment about in6_update_ifa().Martin Pieuchot
2015-07-18Abstract the routing table internals behind an rtable_* API.Martin Pieuchot
Code abusing the radix internals for the routing table should now includes <net/rtable.h> and only deal with "struct rtentry". Code using a radix tree for another purpose can still include <net/radix.h>. Inputs from and ok claudio@, mikeb@
2015-07-18Merge two identical chunks to add new prefixes to the global dataMartin Pieuchot
structures into a function. ok florian@
2015-07-17Remove #if 0'ed code and update comment.Florian Obser
There is no need to handle managed/other flags for router advertisments in the kernel according to the rfcs. Remove stale todo comment; we do handle the on-link bit. OK mpi
2015-07-16Expand ancient NTOHL/NTOHS/HTONS/HTONL macros.Martin Pieuchot
ok guenther@, henning@
2015-07-16Properly layer Router Solicitation code.Martin Pieuchot
Tweak and ok florian@
2015-07-08Use a new RTF_CONNECTED flag for interface (connected) routes.Martin Pieuchot
Recent changes to support multiple interface routes broke the assumption made by all our userland routing daemons concerning interface routes. Historically such routes had a "gateway" sockaddr of type AF_LINK. But to be able to support multiple interface routes as any other multipath routes, they now have a unique "gateway" sockaddr containing their corresponding IP address. This self-describing flag should avoid ambiguity when dealing with interface routes. Issue reported by <mxb AT alumni DOT chalmers DOT se> and benno@ ok claudio@, benno@