summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6_nbr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* add __func__ to panic() and printf() calls in sys/netinet6/*nayden2019-11-291-8/+8
| | | | ok benno@ mortimer@
* Don't check that the ipv6 source address of a neighbor advertisment isbenno2019-10-181-10/+1
| | | | | | | | | | | | | | from a neighbor's address. Sthen@ dug out RFC 4861 4.4 that says that the source address is "An address assigned to the interface from which the advertisement is sent." -- which can be from a network that the receiver does not know about. Indeed my provider sends such a neighbor advertisment for my default gateway, which breaks my uplink. Claudio@ added this check for symetry with NetBSD code when he added the same check to nd6_ns_input(), where it is needed to fix CVE-2008-2476. See also OpenBSD 4.2 errata 15. ok claudio@, kn@
* The timeouts in nd6 are in msec so just use timeout_add_msec() insteadclaudio2018-12-201-7/+5
| | | | | of some complicated match to convert them to ticks. OK visa@ bluhm@ kn@
* We are not going to send a neighbor advertisement from a non-masterflorian2018-12-071-7/+7
| | | | | | carp interface. Move the check to the beginning of the function to make it clear that there are no other side effects happening. OK claudio
* When building ND packets use m_align() to pack the mbuf as optimal asclaudio2018-12-061-5/+4
| | | | | | possible. Because of an optional payload maxlen bytes are used on the m_align so that there is always enough space. OK florian@
* Introduce RTM_CHGADDRATTR to inform userland on the route socket whenflorian2018-07-121-1/+9
| | | | | | | | | | an attribute of an address is changed. For now it's used when IPv6 duplicate address detection finishes. With this slaacd(8) can find out if a configured address is not duplicated without the need to poll. OK phessler, benno, claudio
* Push the KERNEL_LOCK() inside route_input().mpi2018-06-111-3/+1
| | | | ok visa@, tb@
* Replace non mp-safe carp_iamatch6() with mp-safe carp_iamatch().mpi2017-11-231-4/+4
| | | | | | | They have the same functionnality since friehm@ cleaned up balancing code. ok florian@, visa@, patrick@, bluhm@, jmatthew@
* Remove NET_LOCK()'s argument.mpi2017-08-111-4/+3
| | | | Tested by Hrvoje Popovski, ok bluhm@
* Add an error argument to rtm_send() instead of rerolling it insidempi2017-07-281-2/+2
| | | | | | rtdeletemsg(). ok bluhm@
* Purging is at last at hand. Day of Doom is here. All that is evilflorian2017-07-111-24/+3
| | | | | | | | | shall all be cleansed. Remove sending of router solicitations and processing of router advertisements from the kernel. It's handled by slaacd(8) these days. Input & OK bluhm@, mpi@
* If we are sending a neighbor solicitation for a link local addressflorian2017-07-051-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | send it with a link local source address as well. This helps upstream routers with their own source address selection. A reoccurring scenario is: - gateway on fe80::1%if - the gateway does not have an IP in the same prefix as our global address When we want to talk to the outside world we first need to resolve the gateway. We copy the source address from our outgoing packet to the neighbor solicitation packet (a global address) and ask for layer2 information of a link local address. The upstream router now needs to do source address selection of it's own. Since we are coming from a global address and there is no address from the same prefix the router uses another global address lying around. We then drop this with "ND packet from non-neighbor". Reported over the years by a few people, most recently by Marc Peters on bugs@ who confirmed that this fixes the problem. OK stsp@, mpi@
* Notify userland when a new ND is reachable.mpi2017-06-081-1/+5
| | | | | | The same notification is already present in ARP. From Jan Klemkow, ok bluhm@
* Replace remaining splsoftassert(IPL_SOFTNET) by NET_ASSERT_LOCKED().mpi2017-05-161-3/+3
| | | | ok visa@
* percpu counters for raw ipv6 and icmp6 statsjca2017-02-091-7/+7
| | | | ok mpi@
* Take the neighbor solicitation's source address from the packet tobluhm2017-01-031-3/+2
| | | | | | | | send if the mbuf contains the complete IPv6 header. The old check was wrong, it required one additional octet after the header. So the source address selection was depending on the layout of the mbuf chain. OK mpi@
* Remove all splsoftnet() from ND6 converting the non-recrusive ones tompi2016-12-221-7/+6
| | | | | | NET_LOCK(). ok bluhm@
* Use __func__ in debug log to reduce noise when grepping.mpi2016-12-211-18/+16
|
* Remove multiple recursive splsoftnet().mpi2016-11-281-7/+5
| | | | ok bluhm@
* Use rtalloc(9) directly instead of in6_selectsr() in NS/NA outputmpi2016-08-231-56/+27
| | | | | | | | routines. This is another little step towards deprecating 'struct route{,_in6}'. ok bluhm@
* Sizes for free(9) from David Hill.mpi2016-08-221-5/+5
|
* Commit in6_selectsrc() split again, with missing assignment fixed.vgross2016-08-041-4/+4
|
* Revert in_selectsrc() refactoring, it breaks IPv6.mpi2016-07-221-4/+4
| | | | | | Reported by Heiko on bugs@. ok stsp@, claudio@
* Split in6_selectsrc() into a low-level part and a pcb-level part, andvgross2016-07-201-4/+4
| | | | | | convert in_selectsrc() prototype to match. Ok bluhm@ mpi@.
* Expand IN6_IFF_NOTREADY, ok bluhm@mpi2016-07-051-3/+3
|
* Kill nd6_output(), it doesn't do anything since the resolution logicmpi2016-06-151-2/+2
| | | | | | has been moved to nd6_resolve(). ok visa@, millert@, florian@, sthen@
* make nd6_llinfo_settimer take seconds instead of ticks.dlg2016-06-011-7/+6
| | | | | | | | | | most callers are working in seconds, internally it uses seconds, and you can call timeout_add_sec as easily as timeout_add. this also fixes an issue with an nd_defrouter expire which was incorrectly scaled with ticks in a comparison. ok mpi@
* remove dead stores and unused variableschl2016-03-291-5/+1
| | | | ok bluhm@ jca@
* Keep all ether prototypes in one place.mpi2015-12-091-1/+2
|
* Factorize the bits to check if a L2 route is connected, wether it ismpi2015-11-181-3/+29
| | | | | | | attached to a carp(4) or bridge(4) member, to not dereference rt_ifp directly. ok visa@
* Retire ARP load-balacing, thanks for all the fish!mpi2015-11-021-11/+4
| | | | | | | | | One of the keys of our MP work relies on making OpenBSD's kernel simpler! In this case turning ARP processing MP-safe is quite complicated due to the way carp(4) is hooked in arpinput() and nowadays you'd better run kitchensinkd(9) anyway :) ok bluhm@, claudio@, reyk@
* Prefer an existing refcounted ``ifp'' to rt_ifp when possible or use thempi2015-11-021-4/+4
| | | | | | interface index directly. ok bluhm@
* Inspired by satosin(), use inline functions to convert sockaddr dl.bluhm2015-10-221-8/+6
| | | | | | Instead of casts they check wether the incoming object has the expected type. So introduce satosdl() and sdltosa() in the kernel. OK mpi@
* Do not manually decrement rt's refcounter in nd6_lookup() and let thempi2015-09-181-2/+3
| | | | | | callers rtfree(9) it. Inputs and ok bluhm@
* if_put after if_get for nd6_nbr. OK dlg@claudio2015-09-111-1/+7
|
* Kill yet another argument to functions in IPv6. This time ip6_output'sclaudio2015-09-111-3/+3
| | | | | | | ifpp - XXX: just for statistics ifpp is always NULL in all callers so that statistic confirms ifpp is dying OK mpi@
* Kill icmp6_ifstat_inc() and associated per-ifp storage.mpi2015-09-091-6/+1
| | | | | | The SIOCGIFSTAT_ICMP6 is no longer supported. ok dlg@, mikeb@, claudio@
* Rework the code to decide when to perform DAD to no longer rely on thempi2015-08-241-40/+14
| | | | | | | | | 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@
* Kill incorrect and never set ``dad_ignore_ns'' button.mpi2015-07-161-14/+1
| | | | ok phessler@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-5/+13
| | | | | | | | | | | | | | | receiving interface in the packet header of every mbuf. The interface pointer should now be retrieved when necessary with if_get(). If a NULL pointer is returned by if_get(), the interface has probably been destroy/removed and the mbuf should be freed. Such mechanism will simplify garbage collection of mbufs and limit problems with dangling ifp pointers. Tested by jmatthew@ and krw@, discussed with many. ok mikeb@, bluhm@, dlg@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* Remove the "multicast_" prefix from the fields a multicast-only struct.mpi2014-12-171-5/+5
| | | | Prodded by claudio@ and mikeb@
* Use an interface index instead of a pointer for multicast options.mpi2014-12-171-3/+3
| | | | | | | | | | | | Output interface (port) selection for multicast traffic is not done via route lookups. Instead the output ifp is registred when setsockopt(2) is called with the IP{V6,}_MULTICAST_IF option. But since there is no mechanism to invalidate such pointer stored in a pcb when an interface is destroyed/removed, it might lead your kernel to fault. Prevent a fault upon resume reported by frantisek holop, thanks! ok mikeb@, claudio@
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* Rework the handling of interfaces and IPv6 addresses for local delivery.mpi2014-11-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | - Unicast packets sent to any local address will have their interface set to loobpack. - In order to differentiate traffic from interfaces having identical link-local addresses, provide the scoped addresses to pf(4). - Update the icmp6 state lookup logic to match scoped MLL addresses. - Remove a shortcut in ip6_input() that bypasses pf and always look for an RTF_LOCAL route. Packets sent to multicast addresses still retain their original interface due to the fact that local multicast packet delivering does not use if_output. This makes ping6 to link-local addresses work even with pf enabled and "set skip" on loopbacks, reported by Pieter Verberne. Debugged, analysed and tested with mikeb@. ok mikeb@, henning@, sthen@
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-3/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* Do not pass an ifa pointer when we already have a DAD descriptor.mpi2014-11-101-56/+34
| | | | Tweaks and ok florian@
* Rename rtalloc1() into rtalloc(9) and convert its flags to only enablempi2014-11-011-2/+2
| | | | | | functionnality instead of a mix of enable/disable. ok bluhm@, jca@
* Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andmpi2014-10-141-5/+5
| | | | | | kill the macro. ok mikeb@, henning@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-5/+5
| | | | after discussions with beck deraadt kettenis.