summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2017-05-06Checking for IPv4 mapped addreses and dropping the packet is doneAlexander Bluhm
in ip6_input(). Do not check that again in the protocol input functions. OK mpi@
2017-05-06Convert the xformsw definition to C99 style initializer. Also fixAlexander Bluhm
the function declaration of ipe4_input() and avoid a wrong cast. OK mikeb@ dhill@
2017-05-05Expand SA_LEN(), there is no benefit for using the macro in theAlexander Bluhm
kernel. It was only used in IPsec sources. No binary change OK deraadt@
2017-05-04If m is not a continuous mbuf cluster, m_pullup() in pr_input mayAlexander Bluhm
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@
2017-05-04Introduce sstosa() for converting sockaddr_storage with a type safeAlexander Bluhm
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@
2017-05-03Back out rev 1.185 (which made the code match the comment) andTodd C. Miller
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@
2017-05-02Switch OCF and IPsec over to the new AESMike Belopuhov
ok djm
2017-04-19Use the rt_rmx defines that hide the struct rt_kmetrics indirection.Alexander Bluhm
No binary change. OK mpi@
2017-04-17The raw ip input functions are called from several places. Use theAlexander Bluhm
address family passed down with pr_input to check that the correct one is used. OK florian@
2017-04-17Use the address family passed down with pr_input to simplifyAlexander Bluhm
tcp_input(). OK florian@
2017-04-17Use the address family passed down with pr_input to simplifyAlexander Bluhm
udp_input(). OK florian@
2017-04-14Pass down the address family through the pr_input calls. ThisAlexander Bluhm
allows to simplify code used for both IPv4 and IPv6. OK mikeb@ deraadt@
2017-04-11Partially revert previous mallocarray conversions that containDavid Hill
constants. The consensus is that if both operands are constant, we don't need mallocarray. Reminded by tedu@ ok deraadt@
2017-04-09Use mallocarray to allocate multicast group memberships.David Hill
ok deraadt@
2017-04-06Convert bcopy to memcpy where the memory does not overlap, otherwise,David Hill
use memmove. While here, change some previous conversions to a simple assignment. ok deraadt@
2017-04-06Replace bcopy with a simple assignment where both variables areDavid Hill
properly aligned and sockaddr_union fields, or with memcpy when the memory doesn't overlap. OK bluhm@
2017-04-05Replace 2 bcopy()'s with a simple assignment as both variables areDavid Hill
properly aligned malloc(9)d data and sockaddr_union fields. While here, convert the remaining bcopy() to memmove(). with and ok @bluhm
2017-04-05When building counter memory in preparation to copy to userland, alwaysTheo de Raadt
zero the buffers first. All the current objects appear to be safe, however future changes might introduce structure pads. Discussed with guenther, ok bluhm
2017-04-02Fix tcp stats reportingJeremie Courreges-Anglas
Return the sum of per-cpu counters instead of the current cpu's counters. Brainfart on my side. Analysis and fix by Andrei-Marius Radu.
2017-03-27Fix the prefixlen sent by RTM_NEWADDR on new addresses without masks:Rafael Zalamena
calculate the prefixlen using the address before sending the RTM_NEWADDR message. ok claudio@
2017-03-23Replace manual loop with SRPL_FOREACH_SAFE_LOCKED macro.Alexander Bluhm
OK mpi@
2017-03-17carp(4) code is always executed in the 'softnet' thread, so removeMartin Pieuchot
unneeded splnet()/splx() dance. ok mikeb@, bluhm@
2017-03-17Be more strict on all route iterations, lets always make sure that weRafael Zalamena
are not going to get a unicast route by accident. ok mpi@
2017-03-14Make mfc_find() more strict when looking for routes, fixes a problemRafael Zalamena
causing ip_mforward() not to send packets to the userland multicast routing daemon. Reported and tested by Paul de Weerd. ok bluhm@, claudio@
2017-03-13Move PRU_ATTACH out of the pr_usrreq functions into pr_attach.Claudio Jeker
Attach is quite a different thing to the other PRU functions and this should make locking a bit simpler. This also removes the ugly hack on how proto was passed to the attach function. OK bluhm@ and mpi@ on a previous version
2017-03-10percpu counters for ip_ipip.cJeremie Courreges-Anglas
ok bluhm@ dhill@ mpi@
2017-03-07Rename struct etheripstat members for consistency, move them all to 64bitsJeremie Courreges-Anglas
Will make transition to percpu counters easier. ok bluhm@
2017-03-07When the inpcb queue and hash lists are traversed or modified weAlexander Bluhm
need netlock. Remove the obsolete splnet. OK mpi@
2017-03-07Initially in_pcballoc() hooked all new inpcb, including the IPv6Alexander Bluhm
ones, into the IPv4 hash. They cannot be used before bind(2) anyway and then they are rehashed and rehooked, so this was not noticed. Nevertheless put IPv6 PCBs into the IPv6 hash from the beginning. OK jca@ mpi@
2017-03-06Kill global list of IPv6 addresses.Martin Pieuchot
ok bluhm@
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-03Convert the variable argument list of the pr_output functions toAlexander Bluhm
fixed parameters. OK mpi@ claudio@ dhill@
2017-03-02Convert domain declarations to C99 initializers.Martin Pieuchot
ok dhill@, florian@, bluhm@
2017-02-28Some refactoring in ip6_input() needed to un-KERNEL_LOCK() the IPv6Martin Pieuchot
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@
2017-02-22Use c99 struct initialization with protosw.David Hill
This makes it easier to grep for a member, such as .pr_usrreq, and know which functions to review. ok mpi@ bluhm@ jca@
2017-02-20Crank all members of struct ipipstat to 64 bitsJeremie Courreges-Anglas
Will make conversion to percpu counters easier. ok bluhm@
2017-02-20carp(4) percpu countersJeremie Courreges-Anglas
ok florian@
2017-02-17Using ipcomp(4) with IPv6 transport mode failed with protocol familyAlexander Bluhm
not supported. A break in the af switch statement was missing since revision 1.1 from 2001. OK visa@ deraadt@
2017-02-16Revert "Release the NET_LOCK() before entering per-driver ioctl() routine".Martin Pieuchot
This is most likely to be the cause of the deadlock seen by port builders since it's the only changed that happened after a2k17. Instead bring back pirofti@ original hack to release the NET_LOCK() inside iwm(4) and iwn(4). This fixes some splassert reported by bluhm@ Deadlock reported by naddy@ and rpe@ and ajacoutot@ confirmed the deadlock has been introduced post a2k17. Tested by and ok tb@
2017-02-14Get rid of recursive splsoftnet()/splx() dances and convert a timeout toMartin Pieuchot
the timeout_set_proc(9) variant to take the NET_LOCK(). ok mikeb@, bluhm@
2017-02-09Unbreak 'netstat -g' and make multicast route stats sysctl more robust.Rafael Zalamena
ok mpi@
2017-02-09percpu counters for divert(4) statsJeremie Courreges-Anglas
ok dlg@
2017-02-09percpu counters for raw ipv6 and icmp6 statsJeremie Courreges-Anglas
ok mpi@
2017-02-09percpu counters for TCP statsJeremie Courreges-Anglas
ok mpi@ bluhm@
2017-02-09Put back a return that I have removed by accident.Alexander Bluhm
2017-02-08Remove the ipsec protocol callbacks which all do the same. ImplementAlexander Bluhm
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@
2017-02-08Test for NULL before dereferencing a pointer not after.Jonathan Gray
ok krw@
2017-02-07Use percpu counters for icmpJonathan Matthew
ok dlg@ a while ago some input from jca@ who wrote the same diff
2017-02-07Error propagation does neither make sense for ip input path nor forAlexander Bluhm
asynchronous callbacks. Make the IPsec functions void, there is already a counter in the error path. OK mpi@
2017-02-07IPsec packets could be dropped unaccounted if output after cryptoAlexander Bluhm
failed. Add a counter for that case. OK dhill@