summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2017-11-17Drop etheripstat use in ip_ether.cJeremie Courreges-Anglas
Those functions only handle MPLS-in-IP packets, it makes little sense to count those as ethernet-in-IP. ok visa@ mpi@
2017-11-17Drop all Ethernet-in-IP support from gif(4)Jeremie Courreges-Anglas
As a result, ip_ether.c now only deals with MPLS-in-IP. The next commits will move & rename stuff to make this clear. ok visa@ mpi@
2017-11-17Move etherip counters and their allocation to etherip(4)Jeremie Courreges-Anglas
gif(4) now depends on etherip(4) but this is a temporary drawback: we can get rid of etherip_init(), called from the protocol switch, and ip_ether.c should stop using etherip counters once it is clear that this file doesn't handle ethernet-in-IP any more. ok visa@ as part of a larger diff, ok mpi@
2017-11-15etherip(4) now handles etherip sysctls, move/remove code accordingly.Jeremie Courreges-Anglas
ok visa@ as part of a larger diff, ok mpi@
2017-11-15Make etherip(4) the single driver responsible for etherip sysctl entries.Jeremie Courreges-Anglas
One step needed to completely remove ethernet-in-IP support from gif(4). No functional changes. ok visa@ as part of a larger diff, ok mpi@
2017-11-15Unbreak ENCDEBUG kernels by declaring `encdebug' in ip_ipsp.hMartin Pieuchot
2017-11-14Introduce ipsec_sysctl() and move IPsec tunables where they belong.Martin Pieuchot
ok bluhm@, visa@
2017-11-10Introduce a reader version of the NET_LOCK().Martin Pieuchot
This will be used to first allow read-only ioctl(2) to be executed while the softnet taskq is running. Then it will allows us to execute multiple softnet taskq in parallel. Tested by Hrvoje Popovski, ok kettenis@, sashan@, visa@, tb@
2017-11-10Use percpu counters with etheripstat.Visa Hankala
Input and OK jca@, OK florian@
2017-11-08The TF_BLOCKOUTPUT flag is set around all sorwakeup() and sowwakeup()Alexander Bluhm
calls in tcp_input(). When I added this code for socket splicing, I have missed that they may be called indirectly through functions. Although not strictly necessary since we have the sosplice thread, put that flag consistently when we want to prevent that tcp_output() is called in the middle of tcp_input(). As soisconnected(), soisdisconnected(), and socantrcvmore() call the wakeup functions from tcp_input(), set the TF_BLOCKOUTPUT flag around them. OK visa@
2017-11-08Make {ah,esp,ipcomp}stat use percpu counters.Visa Hankala
OK bluhm@, mpi@
2017-11-07Convert all the fields of {ah,esp,ipcomp}stat to uint64.Visa Hankala
This is a preliminary step for using percpu counters with the data. OK mpi@
2017-11-07Remove unused debug macro.Martin Pieuchot
2017-11-06Use %s and __func__ in DPRINTF() to reduce false positive with grep(1).Martin Pieuchot
ok kettenis@, dhill@, visa@, jca@
2017-11-05Finish off pr_drain functions, they haven't been used since 2006.Florian Obser
OK mpi
2017-11-04Stop calling ifp->if_ioctl() inside in{,6}_ioctl().Martin Pieuchot
Instead return EOPNOTSUPP and call it from ifioctl(). This will help getting per-driver ioctl routines outside of need the NET_LOCK(). While here always return ENXIO when ``ifp'' is NULL. ok visa@, florian@
2017-11-02Move PRU_DETACH out of pr_usrreq into per proto pr_detachFlorian Obser
functions to pave way for more fine grained locking. Suggested by, comments & OK mpi
2017-11-01Fix typo in previous resulting in a NULL dereference.Martin Pieuchot
2017-10-31- add one more softnet taskqAlexandr Nedvedicky
NOTE: code still runs with single softnet task. change definition of SOFTNET_TASKS in net/if.c, if you want to have more than one softnet task OK mpi@, OK phessler@
2017-10-29This doesn't need the NET_LOCK, everything is protected by a mutex.Florian Obser
OK mpi, visa
2017-10-29Move NET_{,UN}LOCK into individual slowtimo functions.Florian Obser
Direction suggested by mpi OK mpi, visa
2017-10-27Dump IPsec flows by iterating over the rafdix-tree.Martin Pieuchot
This enforces an order and will allow us to get rid of the global list. ok millert@, visa@, markus@
2017-10-26Stop grabbing the KERNEL_LOCK() in network tasks when `ipsec_in_use'Martin Pieuchot
is set. Accesses to IPsec global data structure are now serialized by the NET_LOCK(). Tested by many, ok visa@, bluhm@
2017-10-25Remove the TCP_FACK option and associated #if{,n}def code.job
TCP_FACK was disabled by provos@ in June 1999. TCP_FACK is an algorithm that decides that when something is lost, all not SACKed packets until the most forward SACK are lost. It may be a correct estimate, if network does not reorder packets. OK visa@ mpi@ mikeb@
2017-10-24Refactor handling of partial TCP acknowledgementsMike Belopuhov
With input from Klemens Nanni, OK visa, mpi, bluhm
2017-10-24Remove some more tests checking for a non-NULL `ifp->if_ioctl'.Martin Pieuchot
if_attach() enforces it is properly defined.
2017-10-24Remove support for never used ioctls originating from KAME.Martin Pieuchot
ok florian@, claudio@, bluhm@
2017-10-22Unconditionally enable TCP selective acknowledgements (SACK)Mike Belopuhov
OK deraadt, mpi, visa, job
2017-10-20Do not test if if_ioctl is NULL, it isn't.Martin Pieuchot
ok florian@, claudio@, visa@, bluhm@
2017-10-18When reusing an mbuf at the upper end of the network stack, stripAlexander Bluhm
off the mbuf properties with m_resethdr(). It is a new packet, especially M_LOOP indicating that it was running through lo(4) should be cleared. Use the ph_loopcnt to prevent looping at the upper end of the stack. Although not strictly necessary in icmp reflect, it is a good idea to increase and check the counter here, like in socket splicing. OK mpi@ sashan@
2017-10-16Handle the case where the parent of a carp(4) is being destroyedMartin Pieuchot
while packets where being passed to IPsec tasks. Found the hardway by Hrvoje Popovski. ok phessler@, claudio@
2017-10-16Last changes before running IPsec w/o KERNEL_LOCK().Martin Pieuchot
Put more NET_ASSERT_LOCK() and document which globals it protects. Add a mutex for pfkeyv2 globals. Convert ipsp_delete_acquire() to timeout_set_proc(). Tested by Hrvoje Popovski, ok bluhm@ visa@
2017-10-11Remove lie talking about splsoftclock().Martin Pieuchot
2017-10-09Reduces the scope of the NET_LOCK() in sysctl(2) path.Martin Pieuchot
Exposes per-CPU counters to real parrallelism. ok visa@, bluhm@, jca@
2017-10-06Unfortunately I removed too much in my previous commit and brokeAlexander Bluhm
divert-packet. Bring back the loop over the global list to find the divert socket.
2017-10-06Kill the divert-packet socket option IP_DIVERTFL to filter packets.Alexander Bluhm
It used a loop over the global list divbtable that would be hard to make MP safe. The port net/dnsfilter does not work without this, it should be converted to divert-to. Neither other ports nor base use this filter feature. ports checked by sthen@; OK mpi@ benno@
2017-09-20Use m_copym() instead of m_dup_pkt() to fix a kernel assert whenVisa Hankala
setting IP options. Issue reported by Kapetanakis Giannis OK mpi@
2017-09-07Replace a goto found in the ipq foreach loop with a simple break.Alexander Bluhm
This is a common idiom when a list element has been found. OK visa@ mpi@
2017-09-06Replace the call to ifa_ifwithaddr() in divert6_output() with aAlexander Bluhm
route lookup to make it MP safe. Only set the mbuf header fields that are needed. Validate the name input. Also use the same variables in IPv4 and IPv6 functions and avoid unneccessary initialization. OK mpi@
2017-09-06Replace the call to ifa_ifwithaddr() in divert_output() with a routeAlexander Bluhm
lookup to make it MP safe. Only set the mbuf header fields that are needed. Validate the name input. OK mpi@
2017-09-05Replace NET_ASSERT_LOCKED() by soassertlocked() in *_usrreq().Martin Pieuchot
Not all of them need the NET_LOCK(). ok bluhm@
2017-09-05Serialize access to IP reassembly queue with a mutex. This letsVisa Hankala
ip_local(), ip_slowtimo() and ip_drain() run without KERNEL_LOCK() and NET_LOCK(). Input and OK mpi@, bluhm@
2017-09-01Simplify list traversal in ip_freef(), and replace a hand-rolledVisa Hankala
list traversal with LIST_FOREACH_SAFE(). OK bluhm@, mpi@
2017-09-01Change sosetopt() to no longer free the mbuf it receives and changeMartin Pieuchot
all the callers to call m_freem(9). Support from deraadt@ and tedu@, ok visa@, bluhm@
2017-08-22Prevent a race against ipsec_in_use.Martin Pieuchot
Problem reported and fix tested by Hrvoje Popovski. ok bluhm@, visa@
2017-08-15Convert hand rolled sockaddr checks to the nam2sin functions.Alexander Bluhm
Especially in tcp_usrreq() connect detect the correct address family based on the inp_flags instead of the sa_family user input. OK mpi@
2017-08-11Remove NET_LOCK()'s argument.Martin Pieuchot
Tested by Hrvoje Popovski, ok bluhm@
2017-08-11Validate sockaddr from userland in central functions. This resultsAlexander Bluhm
in common checks for unix, inet, inet6 instead of partial checks here and there. Some checks are already done at a higher layer, but better be paranoid with user input. OK claudio@ millert@
2017-08-10icmp_mtudisc() might be called by TCP even on loopback after aAlexander Bluhm
retransmit timeout. Do not run path MTU discovery on local routes as we never want that on loopback. For permanent ARP or ND entries disable path MTU discovery as they use the same rt_expire field. This prevents that permanent routes and entries disappear. bug analysis friehm@; OK mpi@
2017-08-08fix typo in previous commit.T.J. Townsend