summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_input.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert bcopy to memcpy as the memory does not overlap.dhill2017-04-061-5/+5
| | | | ok deraadt@
* Kill global list of IPv6 addresses.mpi2017-03-061-3/+1
| | | | ok bluhm@
* Some refactoring in ip6_input() needed to un-KERNEL_LOCK() the IPv6mpi2017-02-281-22/+35
| | | | | | | | | | | | | | forwarding path. Rename ip6_ours() in ip6_local() as this function dispatches packets to the upper layer. Introduce ip6_ours() and get rid of 'goto hbhcheck'. This function will be later used to enqueue local packets. As a bonus this reduces differences with IPv4. Inputs and ok bluhm@
* Remove the ipsec protocol callbacks which all do the same. Implementbluhm2017-02-081-2/+1
| | | | | | it in ipsec_common_input_cb() instead. The code that was copied to ah6_input_cb() is now in ip6_ours() so we can call it directly. OK mpi@
* Make ip6_input() more like ipv4_input() and introduce ip6_ours().bluhm2017-02-061-38/+31
| | | | OK mpi@
* Always allocate counters memory using type M_COUNTERS.jca2017-02-051-2/+2
| | | | | | | This makes the API simpler, and is probably more useful than spreading counters memory other several types, making it harder to track. Prodded by mpi, ok mpi@ stsp@
* Use percpu counters for ip6statjca2017-02-051-60/+58
| | | | | | | | | Try to follow the existing examples. Some notes: - don't implement counters_dec() yet, which could be used in two similar chunks of code. Let's see if there are more users first. - stop incrementing IPv6-specific mbuf stats, IPv4 has no equivalent. Input from mpi@, ok bluhm@ mpi@
* Change the IPv4 pr_input function to the way IPv6 is implemented,bluhm2017-01-291-7/+7
| | | | | | | to get rid of struct ip6protosw and some wrapper functions. It is more consistent to have less different structures. The divert_input functions cannot be called anyway, so remove them. OK visa@ mpi@
* Move nd6 timer initialisation to nd6_init() and call timeout_set()bluhm2016-12-271-13/+1
| | | | | only once during init. OK mpi@
* Typo, "more then" -> "more than"jca2016-12-261-2/+2
|
* A NET_LOCK() was is missing in tcp_sysctl() which shows up as splbluhm2016-12-201-6/+5
| | | | | | | | | | softnet assert failures. It is better to place the lock into net_sysctl() where all the protocol sysctls are called via pr_sysctl. As calling sysctl(2) is in the slow path, doing fine grained locking has no benefit. Many sysctl cases copy out a struct. Having a lock around that keeps the struct consistent. Put assertions in the protocol sysctls that need it. OK mpi@
* Introduce the NET_LOCK() a rwlock used to serialize accesses to the partsmpi2016-12-191-3/+6
| | | | | | | | | | | of the network stack that are not yet ready to be executed in parallel or where new sleeping points are not possible. This first pass replace all the entry points leading to ip_output(). This is done to not introduce new sleeping points when trying to acquire ART's write lock, needed when a new L2 entry is created via the RT_RESOLVE. Inputs from and ok bluhm@, ok dlg@
* Merge two "#ifdef MROUTING" blocks.mpi2016-11-281-26/+33
| | | | | | | It's one more step towards splitting ip6_input() in two and it reduces differences with v4. ok bluhm@
* Automatically create a default lo(4) interface per rdomain.mpi2016-11-141-5/+6
| | | | | | | | | | | | | | | | | | In order to stop abusing lo0 for all rdomains, a new loopback interface will be created every time a rdomain is created. The unit number will be the same as the rdomain, i.e. lo1 will be attached to rdomain 1. If this loopback interface is already in use it wont be possible to create the corresponding rdomain. In order to know which lo(4) interface is attached to a rdomain, its index is stored in the rtable/rdomain map. This is a long overdue since the introduction of rtable/rdomain. It also fixes a recent regression due to resetting the rdomain of an incoming packet reported by semarie@, Andreas Bartelt and Nils Frohberg. ok claudio@
* Kill ip6_forward_rt reducing differences between v4 and v6.mpi2016-08-241-33/+16
| | | | | | A single forwarding cache is not the answer. The answer is 42... err PF! ok bluhm@
* protect a pf specific function with the correct #if. Fixes ramdisk building.phessler2016-07-191-1/+3
| | | | | | | (we got lucky before, because the variable that used to be checked was always available) OK bluhm@
* In ip6_input() use a shortcut to detect our own address if the pfbluhm2016-07-191-2/+2
| | | | | state key is linked to a socket inp. OK mpi@ henning@
* Use a flag to indicate that a packet has been received on an IPv6mpi2016-07-191-4/+4
| | | | | | | | | anycast address. This will allow us to split ip6_input() in two parts using a queue in the middle. ok jca@, florian@, bluhm@
* Kill the rtableid variable in ip6_input(). It does not make sensebluhm2016-07-181-6/+3
| | | | | to store a field in an extra variable that is only accessed twice. OK mpi@
* Drop received packets with an IPv4-compatible address as source ormpi2016-07-141-6/+3
| | | | | | | | | | destination as per RFC4213. We're not in 1999 anymore, what was earlier a "stronger check than RFC1933" is now a best practice. This matches the behavior of the reject (R) routes added by default by netstart(8). ok jca@, florian@, claudio@, bluhm@
* Move Hop-by-Hop processing into its own function ip6_hbhchcheck().mpi2016-07-061-71/+91
| | | | | | | This function will help splitting the IPv6 input path in two, in order to run the first part without KERNEL_LOCK() held. Tested by Hrvoje Popovski, ok bluhm@
* Expand IN6_IFF_NOTREADY, ok bluhm@mpi2016-07-051-6/+6
|
* Remove sysctl net.inet6.ip6.v6onlyjca2016-05-191-3/+1
| | | | | | | | This sysctl is a no-op, read-only since it was introduced. There are no plans to support IPv4-mapped addresses on OpenBSD, thus this sysctl is meaningless. Noticed by djm@, ok claudio@ mpi@ sthen@ henning@
* Remove duplicate check.mpi2016-05-071-16/+1
| | | | ok sthen@, visa@
* Instead of freeing a cached RTF_MPATH route after using it, free itmpi2016-04-191-1/+2
| | | | | | | when the next packet needs to be forwarded, just like if the route was invalid. ok mikeb@, claudio@
* Search in the correct routing table if NPF is not defined.mpi2016-04-111-3/+1
| | | | ok jca@, phessler@, mikeb@
* remove dead stores and unused variableschl2016-03-291-2/+1
| | | | ok bluhm@ jca@
* Change a bunch of (<blah> *)0 to NULL.krw2016-03-141-2/+2
| | | | ok beck@ deraadt@
* Introduce in{,6}_hasmulti(), two functions to check in the hot path ifmpi2016-01-211-4/+2
| | | | | | an interface joined a specific multicast group. ok phessler@, visa@, dlg@
* fix comment typossthen2016-01-061-3/+3
|
* ip_send()/ip6_send() allow PF to send response packet in ipsoftnet task.sashan2015-12-031-1/+36
| | | | | | | | | | | this avoids current recursion to pf_test() function. the change also switches icmp_error()/icmp6_error() to use ip_send()/ip6_send() so they are safe for PF. The idea comes from Markus Friedl. bluhm, mikeb and mpi helped me a lot to get it into shape. OK bluhm@, mpi@
* Store the index of the lo0 interface instead of a pointer to itsmpi2015-11-111-2/+2
| | | | | | | | descriptor. Allow to get rid of two if_ref() in the output paths. ok dlg@
* RFC 2292 API support was removed 9 years ago, but left in a binary compattedu2015-10-291-7/+6
| | | | | | | ABI form for the sake of existing programs. no programs from that era have been able to run for quite some time. Kill it all. ok deraadt florian millert mpi (I believe this is my first IPv6 diff. Future, here I come!)
* replace pointer arithmetic and casts with offsetofjsg2015-10-231-2/+2
| | | | ok mpi@ bluhm@
* Stop checking for RTF_UP directly, call rtisvalid(9) instead.mpi2015-10-191-3/+2
| | | | | | While here add two missing ``rtableid'' checks in in6_selectsrc(). ok bluhm@
* Make use of rtisvalid(9) to check if local route entries match existingmpi2015-10-131-2/+2
| | | | | | configured addressses. ok mikeb@
* if_put for ip6_input. OK mpi@claudio2015-09-111-14/+15
|
* Fewer in6_ifstat_inc()mpi2015-09-101-25/+2
| | | | ok mikeb@
* Kill IP_ROUTETOETHER.mpi2015-07-161-2/+2
| | | | | | | | | This pseudo-option is a hack to support return-rst on bridge(4). It passes Ethernet information via a "struct route" through ip_output(). "struct route" is slowly dying... ok claudio@, benno@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-4/+5
| | | | | | | | | | | | | | | 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@
* More damned eye searing whitespace. No change to .o files.krw2015-06-081-11/+11
|
* replace the use of ifqueues for most input queues serviced by netisrdlg2015-04-101-12/+4
| | | | | | | | | | | | | | | | | with niqueues. this change is so big because there's a lot of code that takes pointers to different input queues (eg, ether_input picks between ipv4, ipv6, pppoe, arp, and mpls input queues) and falls through to code to enqueue packets against the pointer. if i changed only one of the input queues id have to add sepearate code paths, one for ifqueues and one for niqueues in each of these places by flipping all these input queues at once i can keep the currently common code common. testing by mpi@ sthen@ and rafael zalamena ok mpi@ sthen@ claudio@ henning@
* 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@
* Implement 2 sysctl to retrieve the multicast forwarding cache (mf6c) and theclaudio2015-02-091-6/+14
| | | | | multicast interface table (mif6). Will be used by netstat soon. Looked over by guenther@
* provide a net.inet6.ip6.ifq sysctl so people can see and fiddledlg2015-02-091-4/+7
| | | | | | with the ip6intrq. ok claudio@
* Remove a chunk missed in previous scope ID shuffling creating wrongmpi2015-02-091-13/+1
| | | | | | states for external traffic through a link-local address. Found the hard way and fix tested by bluhm@.
* Make sure pf(4) does not see embedded scopes.mpi2015-02-051-3/+35
| | | | | | | | | | | | | Packets destinated to link-local addresses are looped back with embedded scopes because we cannot restore them using the receiving interface (lo0). Embedded scopes are needed by the routing table to match RTF_LOCAL routes, but pf(4) never saw them and existing rules are likely to break without teaching the rule engine about them, found by dlg@ the hard way. So save and restore embedded scopes around pf_test() for packets going through loopback. ok dlg@, mikeb@
* <netinet6/in6_ifattach.h> is not needed here.mpi2015-01-191-2/+1
|
* unifdef INET in net code as a precursor to removing the pretend option.tedu2014-12-191-3/+1
| | | | | long live the one true internet. ok henning mikeb
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@