summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/frag6.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Do not use the flow of the first fragment to store ECN information.bluhm2019-08-261-5/+6
| | | | | | Handle the ECN in the fragment queue. Reported-by: syzbot+0aa80b25e9041001cac8@syzkaller.appspotmail.com fix from FreeBSD; OK claudio@
* Instead of calculating the mbuf packet header length here and there,bluhm2018-09-101-9/+2
| | | | | | put the algorithm into a new function m_calchdrlen(). Also set an uninitialized m_len to 0 in NFS code. OK claudio@
* During fragment reassembly, mbuf chains with packet headers werebluhm2018-09-101-2/+5
| | | | | | | created. Add a new function m_removehdr() do convert packet header mbufs within the chain to regular mbufs. Assert that the mbuf at the beginning of the chain has a packet header. found by Maxime Villard in NetBSD; from markus@; OK claudio@
* frag6_slowtimo: push NET_LOCK into frag6_freef around icmp6_error.cheloha2018-08-221-8/+6
| | | | | | | | | | | | | | | icmp6_error() still probably needs the NET_LOCK, as the call chain icmp6_error -> icmp6_reflect -> rt_match -> rt_clone -> rtrequest is possible. The fragment discard loop in frag6_slowtimo and the other cleanup bits in frag6_freef do not require it however. So push the lock down into frag6_freef around icmp6_error. Prompted by mpi. Discussed with bluhm and kn. Regress test help by bluhm. Additional testing by kn. ok kn@ visa@ mpi@
* The function ip6_get_prevhdr() did return a pointer into a mbuf.bluhm2018-02-011-9/+15
| | | | | | It was not guaranteed that the mbuf data was not somewhere else in the chain. So return an offset and do a proper mbuf pulldown. found by Maxime Villard; from NetBSD; with markus@; OK deraadt@
* Put the net lock around frag6_freef() as it sends ICMP6 errorbluhm2017-11-141-4/+8
| | | | | messages. Splassert was triggered by regress/sys/netinet6/frag6. OK mpi@ sashan@ visa@
* Remove 18 year old #if 0.mpi2017-11-131-26/+3
| | | | ok visa@, benno@
* Serialize access to the IPv6 reassembly queue with a mutex.visa2017-11-071-83/+71
| | | | | | | | | This lets the code run without KERNEL_LOCK() and NET_LOCK(). In addition, this patch reorganizes a part of the code, to move some of the memory release operations outside the critical section. Input and OK mpi@, OK florian@, an earlier version OK bluhm@
* Finish off pr_drain functions, they haven't been used since 2006.florian2017-11-051-18/+1
| | | | OK mpi
* Move NET_{,UN}LOCK into individual slowtimo functions.florian2017-10-291-2/+4
| | | | | | Direction suggested by mpi OK mpi, visa
* Allocate IPv6 reassembly structs using pools instead of malloc(),visa2017-10-271-18/+25
| | | | | | and drop the now redundant allocation type M_FTABLE. OK mikeb@, bluhm@, mpi@
* Replace macro `IP6_REASS_MBUF' with direct use of field `ip6af_m'.visa2017-10-261-7/+7
| | | | OK bluhm@, mpi@
* Replace remaining splsoftassert(IPL_SOFTNET) by NET_ASSERT_LOCKED().mpi2017-05-161-2/+2
| | | | ok visa@
* Pass down the address family through the pr_input calls. Thisbluhm2017-04-141-2/+2
| | | | | allows to simplify code used for both IPv4 and IPv6. OK mikeb@ deraadt@
* Use percpu counters for ip6statjca2017-02-051-9/+9
| | | | | | | | | 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@
* Assert that every slow/fast timeout routine is called at IPL_SOFTNET.mpi2016-11-281-4/+3
| | | | This removes multipe recursive splsoftnet()/splx() dances.
* When the IPv6 network stack receives an empty non atomic fragment,bluhm2016-10-241-1/+7
| | | | | | | | just drop it. It can never overlap existing content, there is no ambiguous payload. So save resources and do not try to insert it into the queue. This makes our IPv6 stack behave like pf fragment reassembly. OK deraadt@
* Kill ip6_forward_rt reducing differences between v4 and v6.mpi2016-08-241-14/+3
| | | | | | A single forwarding cache is not the answer. The answer is 42... err PF! ok bluhm@
* Sizes for free(9) from David Hill.mpi2016-08-221-14/+14
|
* Sync no-argument function declaration and definition by adding (void).naddy2016-03-071-3/+3
| | | | ok mpi@ millert@
* rewrite if to be more clear. ok bluhm stsptedu2015-12-031-7/+4
|
* Kill dead code missed in per-ifp counter removal.mpi2015-10-221-19/+1
| | | | ok millert@, bluhm@
* Remove superfluous NULL checks.mpi2015-10-191-4/+2
| | | | ifa are refcounted to ensure that rt_ifa is always valid.
* Kill in6_ifstat_inc() and associated per-ifp storage.mpi2015-09-101-7/+1
| | | | | | The SIOCGIFSTAT_IN6 is no longer supported. ok mikeb@, claudio@, dlg@
* Kill some commented out in6_ifstat_inc().mpi2015-09-091-4/+1
|
* unifdef IN6_IFSTAT_STRICT.mpi2015-07-081-16/+1
| | | | ok deraadt@, millert@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-2/+2
| | | | | | | | | | | | | | | 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@
* Do not use a "struct route" when a "struct rtentry" is enough.mpi2014-12-081-18/+16
| | | | ok millert@, bluhm@
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-3/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andmpi2014-10-141-4/+4
| | | | | | kill the macro. ok mikeb@, henning@
* Kill rtalloc() and update rtalloc1() and rtalloc_mpath() to no longermpi2014-09-271-2/+3
| | | | | | rely on "struct route" that should die. ok claudio@
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-14/+14
| | | | after discussions with beck deraadt kettenis.
* "struct pkthdr" holds a routing table ID, not a routing domain one.mpi2014-04-141-2/+2
| | | | | | | | | | | | | | Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
* Replace most of our formating functions to convert IPv4/6 addresses frommpi2013-11-111-3/+7
| | | | | | | | network to presentation format to inet_ntop(). The few remaining functions will be soon converted. ok mikeb@, deraadt@ and moral support from henning@
* Put a large chunk of the IPv6 rdomain support in-tree.phessler2013-10-201-1/+2
| | | | | | Still some important missing pieces, and this is not yet enabled. OK bluhm@
* The header file netinet/in_var.h included netinet6/in6_var.h. Thisbluhm2013-10-171-2/+2
| | | | | | | created a bunch of useless dependencies. Remove this implicit inclusion and do an explicit #include <netinet6/in6_var.h> when it is needed. OK mpi@ henning@
* Sync comment with reality, the draft is now an RFC and OpenBSD followsmpi2013-08-271-5/+5
| | | | | | it since bluhm@ implemented it in 2012. From Loganaden Velvindron, ok claudio@
* Replace all ovbcopy with memmove; swap the src and dst arguments tooderaadt2013-06-111-3/+3
| | | | ok otto
* Remove a bunch of sockaddr_in6 pointer casts and replace othersbluhm2013-05-311-2/+2
| | | | | | with sin6tosa() or satosin6() inline functions. This allows the compiler to check the types more strictly. OK mpi@
* simple replacement of LIST_END with NULL. ok mpitedu2013-03-221-19/+14
|
* Replace the cast to struct in6_ifaddr pointer with the ifatoia6() macro.bluhm2013-03-041-2/+2
| | | | | No binary change. OK claudio@
* change the malloc(9) flags from M_DONTWAIT to M_NOWAIT; OK millert@gsoares2012-12-281-3/+3
|
* Add a short cut for atomic IPv6 fragments. They will be processedbluhm2012-01-241-2/+15
| | | | | | immediately and not go through the fragment queue. See draft-gont-6man-ipv6-atomic-fragments-00.txt. tested and ok sperreault@
* Do not keep state when dropping overlapping IPv6 fragments in pfbluhm2012-01-231-14/+8
| | | | | and IPv6 stack. ok sperreault@
* Implement RFC 5722 and drop all IPv6 fragments that belong to abluhm2012-01-101-9/+26
| | | | | packet with overlapping fragments. ok henning@
* Flush the cached IPv6 forward route every 500 ms. This preventsbluhm2012-01-101-3/+2
| | | | | | | | wrong checks for local addresses and wrong packet forwarding in environments with only one communication partner and changing addresses or routes. Remove the #if 0 around the existing code to make IPv6 behave like IPv4. ok henning@
* Remove the IPv6 fragment overlapping length adjustment code. Itbluhm2012-01-091-52/+5
| | | | | | was already #if 0 and will never come back. Remove unused fragment struct fields and sort the others. ok henning@
* Replace the hand-crafted queue for IPv6 fragments with LIST.bluhm2012-01-091-76/+45
| | | | ok henning@