Age | Commit message (Collapse) | Author |
|
IPsec packets without additional enqueueing.
OK mpi@
|
|
buffers.
This is one step towards unlocking TCP input path. Note that all the
functions asserting for the socket lock are not necessarilly MP-safe.
All the fields of 'struct socket' aren't protected.
Introduce a new kernel-only kqueue hint, NOTE_SUBMIT, to be able to
tell when a filter needs to lock the underlying data structures. Logic
and name taken from NetBSD.
Tested by Hrvoje Popovski.
ok claudio@, bluhm@, mikeb@
|
|
a TDB from the hash table without actually free()ing it. That way we
can modify the TDB and then put it back in using puttdb().
ok claudio@
|
|
|
|
to ipip_input_if() and always pass the ifp. Only dump the packet
to bpf if we are called with a gif(4) interface.
OK mpi@
|
|
bugs could easily result in use-after-free or double free. Introduce
m_freemp() which automatically resets the pointer before freeing
it. So we have less dangling pointers in the kernel.
OK krw@ mpi@ claudio@
|
|
error. Make the ip_mforward() return value consistent. Simplify
the caller logic in ipv6_input() like in IPv4.
OK mpi@
|
|
in ipip_input_gif(). This prevents a use-after-free if there is a
bug in the IP input functions.
OK mpi@
|
|
try to remove a route from the table if it is and invalid cache.
This is a step towards decoupling code dealing with userland and kernel
inserted routes.
ok bluhm@
|
|
aren't protected by the NET_LOCK().
While here change lock assertions in rt_{set,put}gwroute(), the NET_LOCK()
is enough.
Tested by Hrvoje Popovski.
ok jmatthew@, claudio@
|
|
IPv4 & IPv6 dispatch functions outside the KERNEL_LOCK().
We currently rely on the NET_LOCK() serializing access to most global
data structures for that. IP input queues are no longer used in the
forwarding case. They still exist as boundary between the network and
transport layers because TCP/UDP & friends still need the KERNEL_LOCK().
Since we do not want to grab the NET_LOCK() for every packet, the
softnet thread will do it once before processing a batch. That means
the L2 processing path, which is currently running without lock, will
now run with the NET_LOCK().
IPsec isn't ready to run without KERNEL_LOCK(), so the softnet thread
will grab the KERNEL_LOCK() as soon as ``ipsec_in_use'' is set.
Tested by Hrvoje Popovski.
ok visa@, bluhm@, henning@
|
|
|
|
ether_input(). Now we use mbuf tags instead of modifying the MAC
address.
ok mpi@
|
|
This will help transitionning to an un-KERNEL_LOCK()ed IP
forwarding path.
Disucssed with bluhm@, ok claudio@
|
|
currently protected by the NET_LOCK().
They are not accessed in the hot path, so protecting them with a
mutex could be an option. However since we're now going to run
with a NET_LOCK() for some time, assert that it is held.
IPsec is not yet ready to run without KERNEL_LOCK(), so assert it
is held, even in the forwarding path.
Tested by sthen@, ok visa@, claudio@, bluhm@
|
|
upcoming diffs, no functional change.
OK mpi@
|
|
Grab the lock before calling carpdetach().
ok bluhm@
|
|
ifdef IPSEC to fix the clang build when IPSEC is not defined.
ok deraadt@ bluhm@
|
|
as the pr_input functions. Add an assert that IPv4 delivery ends
in IP proto done to assure that IPv4 protocol functions work like
IPv6.
OK mpi@
|
|
if at least one vhid is in state MASTER.
from Florian Riehm; OK florian@
|
|
and outer header. Reset values depending on the the mbuf when the
mbuf is adjusted. Check the length of the inner IP header with the
correct size in case of IPv6. Check the IPv4 header size including
IP options. For the IPIP statistics the inner header length has
to be subtracted from the packet size as the outer header has already
been stripped off.
OK mpi@
|
|
address family passed to ipip_input().
OK mpi@
|
|
and give them better names.
input and OK mikeb@
|
|
in ip6_local() to our IPv6 stack.
OK mikeb@
|
|
Free the options in icmp_input_if() after a successful call to
icmp_reflect().
bug report and analysis by Hendrik Gerlach
OK krw@ claudio@ phessler@
|
|
<netinet/tcp_debug.h>.
The IPv6 variant was always included and the IPv4 version is not
present on all systems.
Most of the offending ports are already fixed, thanks to sthen@!
|
|
packets. This is the IP in IP protocol input function, so call it
ipip_input(). Rename the existing ipip_input() to ipip_input_gif()
as it is the input function used by the gif interface. Pass the
address family to make it consistent with pr_input. Use __func__
in debug print and panic messages. Move all ipip prototypes to the
ip_ipip.h header file.
OK dhill@ mpi@
|
|
out what is going on. There were also some inconsistencies that
seem to be oversights. Use more specific the #ifdefs.
OK mpi@
|
|
* use a variable to allow disabling debugs on run-time
* fix a potential memory leak on copyout() failure
* don't just blindly use the first address provided by ifalist
ok bluhm@
|
|
ok bluhm@
|
|
ok visa@
|
|
setsockopt(), otherwise use non-blocking malloc() for network stack
calls.
ok bluhm@
|
|
when finding one. Since rtfree() is being called and rt_llinfo being
removed, add checks everywhere to make sure we are using a route that is
not being removed.
ok bluhm@
|
|
this is done in in6_pcbconnect().
OK mpi@
|
|
they have been decrypted. That means that all the IP header fields
were checked twice. Also fragment reassembly was tried twice.
At pf incoming packets in tunnel mode appeared twice on the enc0
interface, once as IP-in-IP and once as the inner packet. In the
outgoing path pf only sees the inner packet. Asymmetry is bad for
stateful filtering.
IPv6 shows that IPsec works without that. After decrypting immediately
continue with local delivery. In tunnel mode the IP-in-IP protocol
functions pass the inner header to ip6_input(). In transport mode
only pf_test() has to be called for the enc0 device.
Introduce ip_local() to avoid needless processing and cleaner pf
behavior in IPv4 IPsec.
OK mikeb@
|
|
code in tcp_usrreq(PRU_CONNECT). Do not access sockaddr_in before
checking the address family. Return EAFNOSUPPORT error in the
default case.
OK mikeb@
|
|
early if the IPsec security protocol is unknown. ipsec_common_input()
and ipsec_common_input_cb() can only be called with the IP protocols
ESP, AH, or IPComp. Everything else is a programming mistake.
OK claudio@
|
|
in ip6_input(). While there avoid an ugly #ifdef in ipv4_input().
OK mikeb@
|
|
decrypted packets in the input path were not checked with pf. So
with stateful filtering on enc0, direction aware protocols like
ping or TCP did not pass. Add an explicit pf_test() in
ipsec_common_input_cb() for IPv6 transport mode to fix this.
OK mikeb@
|
|
|
|
rip_output() function is never called via the pr_output pointer.
rip_usrreq(PRU_SEND) calls rip_output() directly. raw_usrreq() is
never called from inetsw. Situation in inet and inet6 is analog.
OK claudio@ mikeb@
|
|
No binary change.
OK mpi@
|
|
in ip6_input(). Do not check that again in the protocol input
functions.
OK mpi@
|
|
the function declaration of ipe4_input() and avoid a wrong cast.
OK mikeb@ dhill@
|
|
kernel. It was only used in IPsec sources. No binary change
OK deraadt@
|
|
change the pointer. Then *mp keeps the invalid pointer and it might
be used. Fix the potential use after free and also reset *mp in
other places to have less dangling pointers to freed mbufs.
OK mpi@ mikeb@
|
|
inline function instead of casting it to sockaddr. While there,
use inline instead of __inline for all these conversions. Some
struct sockaddr casts can be avoided completely.
OK dhill@ mpi@
|
|
adjust the comment to match reality (or at least rfc7323) instead.
This brings us back in line with the behavior of Net and Free.
From Lauri Tirkkonen. OK bluhm@
|
|
ok djm
|
|
No binary change.
OK mpi@
|