aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6
Commit message (Collapse)AuthorAgeFilesLines
* Remove "prefer_source" address selection option. FreeBSD has had anHiroki Sato2012-07-091-1/+1
| | | | | | | | implementation of RFC 3484 for this purpose for a long time and "prefer_source" was never implemented actually. ND6_IFF_PREFER_SOURCE macro is left intact. Notes: svn path=/head/; revision=238273
* Implement handling of "atomic fragements" as outlined inBjoern A. Zeeb2012-07-081-0/+13
| | | | | | | | | | draft-gont-6man-ipv6-atomic-fragments to mitigate one class of possible fragmentation-based attacks. MFC after: 5 days Notes: svn path=/head/; revision=238248
* As mentioned in the commit message of r237571 (copied from a prototypeBjoern A. Zeeb2012-07-081-1/+3
| | | | | | | | | | patch of mine) also check if the 2nd in6_setscope() failed and return the error in that case. MFC after: 5 days Notes: svn path=/head/; revision=238222
* When ip_output()/ip6_output() is supplied a struct route *ro argument,Gleb Smirnoff2012-07-042-20/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | it skips FLOWTABLE lookup. However, the non-NULL ro has dual meaning here: it may be supplied to provide route, and it may be supplied to store and return to caller the route that ip_output()/ip6_output() finds. In the latter case skipping FLOWTABLE lookup is pessimisation. The difference between struct route filled by FLOWTABLE and filled by rtalloc() family is that the former doesn't hold a reference on its rtentry. Reference is hold by flow entry, and it is about to be released in future. Thus, route filled by FLOWTABLE shouldn't be passed to RTFREE() macro. - Introduce new flag for struct route/route_in6, that marks route not holding a reference on rtentry. - Introduce new macro RO_RTFREE() that cleans up a struct route depending on its kind. - All callers to ip_output()/ip6_output() that do supply non-NULL but empty route should use RO_RTFREE() to free results of lookup. - ip_output()/ip6_output() now do FLOWTABLE lookup always when ro->ro_rt == NULL. Tested by: tuexen (SCTP part) Notes: svn path=/head/; revision=238092
* Remove route caching from IP multicast routing code. There is noGleb Smirnoff2012-07-022-15/+16
| | | | | | | | | | reason to do that, and also, cached route never got unreferenced, which meant a reference leak. Reviewed by: bms Notes: svn path=/head/; revision=238016
* Move common code parts to sctp_common_input_processing().Michael Tuexen2012-07-021-146/+28
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=238003
* Kick the current-state report timer when a V1 group report wouldBruce M Simpson2012-06-281-0/+1
| | | | | | | | | | be triggered. Submitted by: rpaulo@ MFC after: 3 days Notes: svn path=/head/; revision=237736
* Fix a typo in MLD query exponent processing.Bruce M Simpson2012-06-281-1/+1
| | | | | | | | Submitted by: rpaulo@ MFC after: 3 days Notes: svn path=/head/; revision=237735
* In MLDv2 general query processing, do not enforce the strict checkBruce M Simpson2012-06-281-7/+1
| | | | | | | | | | on query origins. Submitted by: Gu Yong MFC after: 3 days Notes: svn path=/head/; revision=237734
* Pass the src and dst address of a received packet explicitly around.Michael Tuexen2012-06-281-9/+37
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=237715
* Fix a LOR acquiring the if_afdata lock while holding an rtentry lock.Xin LI2012-06-251-18/+16
| | | | | | | | | | | | | | | Possibly do some entra work in case we would not get into the ifa0 != NULL paths later as we already do for the mltaddr before. XXX We should possibly error in case in6_setscope fails. Reference: http://lists.freebsd.org/pipermail/freebsd-net/2011-September/029829.html Submitted by: bz MFC after: 1 week Notes: svn path=/head/; revision=237571
* Unify sctp_input() and sctp6_input().Michael Tuexen2012-06-251-105/+79
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=237569
* Whitespace cleanup.Michael Tuexen2012-06-251-3/+3
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=237565
* Pass the packet length explicitly around.Michael Tuexen2012-06-241-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=237542
* Do packet logging in a consistent way.Michael Tuexen2012-06-241-3/+5
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=237540
* Just add a comment to further investigate when being closer to that codeBjoern A. Zeeb2012-06-221-0/+1
| | | | | | | again next time. The condition of the 2nd if() is very unlikely ever met. Notes: svn path=/head/; revision=237459
* Pass flowid explicitly through the stack instead of taking it fromMichael Tuexen2012-06-141-7/+22
| | | | | | | | | | the mbuf chain at different places. While there: Fix several bugs related to VRFs. MFC after: 3 days Notes: svn path=/head/; revision=237049
* Deliver IPV6_TCLASS, IPV6_HOPLIMIT and IPV6_PKTINFO cmsgs (ifMichael Tuexen2012-06-121-25/+65
| | | | | | | | | | requested) on IPV6 sockets, which have been marked to be not IPV6_V6ONLY, for each received IPV4 packet. MFC after: 3 days Notes: svn path=/head/; revision=236958
* Plug two interface address refcount leaks in early error return casesBjoern A. Zeeb2012-06-051-1/+6
| | | | | | | | | | | in the ioctl path. Reported by: rpaulo Reviewed by: emax MFC after: 3 days Notes: svn path=/head/; revision=236615
* Plug reference leak.Maksim Yevmenkin2012-06-031-10/+14
| | | | | | | | | | | | | | | | | Interface routes are refcounted as packets move through the stack, and there's garbage collection tied to it so that route changes can safely propagate while traffic is flowing. In our setup, we weren't changing or deleting any routes, but the refcounting logic in ip6_input() was wrong and caused a reference leak on every inbound V6 packet. This eventually caused a 32bit overflow, and the resulting 0 value caused the garbage collection to run on the active route. That then snowballed into the panic. Reviewed by: scottl MFC after: 3 days Notes: svn path=/head/; revision=236501
* Seperate SCTP checksum offloading for IPv4 and IPv6.Michael Tuexen2012-05-302-15/+15
| | | | | | | | | | While there: remove some trainling whitespaces. MFC after: 3 days X-MFC with: 236170 Notes: svn path=/head/; revision=236332
* When we return deprecated addresses, we need to reference them.Maksim Yevmenkin2012-05-301-3/+9
| | | | | | | | Reviewed by: bz, scottl MFC after: 3 days Notes: svn path=/head/; revision=236327
* It turns out that too many drivers are not only parsing the L2/3/4Bjoern A. Zeeb2012-05-284-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | headers for TSO but also for generic checksum offloading. Ideally we would only have one common function shared amongst all drivers, and perhaps when updating them for IPv6 we should introduce that. Eventually we should provide the meta information along with mbufs to avoid (re-)parsing entirely. To not break IPv6 (checksums and offload) and to be able to MFC the changes without risking to hurt 3rd party drivers, duplicate the v4 framework, as other OSes have done as well. Introduce interface capability flags for TX/RX checksum offload with IPv6, to allow independent toggling (where possible). Add CSUM_*_IPV6 flags for UDP/TCP over IPv6, and reserve further for SCTP, and IPv6 fragmentation. Define CSUM_DELAY_DATA_IPV6 as we do for legacy IP and add an alias for CSUM_DATA_VALID_IPV6. This pretty much brings IPv6 handling in line with IPv4. TSO is still handled in a different way and not via if_hwassist. Update ifconfig to allow (un)setting of the new capability flags. Update loopback to announce the new capabilities and if_hwassist flags. Individual driver updates will have to follow, as will SCTP. Reported by: gallatin, dim, .. Reviewed by: gallatin (glanced at?) MFC after: 3 days X-MFC with: r235961,235959,235958 Notes: svn path=/head/; revision=236170
* Correctly get the payload length in host byte order. While weBjoern A. Zeeb2012-05-261-4/+4
| | | | | | | | | | | | | already plan to support >64k payload here, the IPv6 header payload length obviously is only 16 bit and the calculations need to be right. Reported by: dim Tested by: dim MFC after: 1 day X-MFC: with r235958 Notes: svn path=/head/; revision=236130
* Get rid of SCTP specific code to avoid CRC32C computations on loopback.Michael Tuexen2012-05-261-5/+0
| | | | | | | | Just just offloading. MFC after: 3 days Notes: svn path=/head/; revision=236087
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-251-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | Use M_ZERO with malloc rather than calling bzero() ourselves. Change if () panic() checks to KASSERT()s as they are only catching invariants in code flow but not dependent on network input/output. Move initial assigments indirecting pointers after the lock has been aquired. Passing layer boundries, reset M_PROTOFLAGS. Remove a NULL assignment before free. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235986
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-251-63/+80
| | | | | | | | | | | | | | | Factor out Hop-By-Hop option processing. It's still not heavily used, it reduces the footprint of ip6_input() and makes ip6_input() more readable. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235962
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-251-5/+16
| | | | | | | | | | | | | | | Defer checksum calulations on UDP6 output and respect the mbuf flags set by NICs having done checksum validation for us already, thus saving the computing time in the input path as well. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235959
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-252-12/+63
| | | | | | | | | | | | | | | | | | | Add support for delayed checksum calculations in the IPv6 output path. We currently cannot offload to the card if we add extension headers (which incl. fragmentation). Fix two SCTP offload support copy&paste bugs: calculate checksums if fragmenting and no need to flag IPv4 header checksums in the IPv6 forwarding path. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235958
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-252-5/+8
| | | | | | | | | | | | | | | | Hide the ip6aux functions. The only one referenced outside ip6_input.c is not compiled in yet (__notyet__) in route6.c (r235954). We do have accessor functions that should be used. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days X-MFC: KPI? Notes: svn path=/head/; revision=235956
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-251-2/+1
| | | | | | | | | | | | | | Simplify the code removing a return from an earlier else case, not differing from the default function return called now. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235955
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-251-0/+2
| | | | | | | | | | | | | | We currently nowhere set IP6A_SWAP making the entire check useless with the current code. Keep around but do not compile in. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235954
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-251-2/+2
| | | | | | | | | | | | | No need to hold the (expensive) rt lock over (expensive) logging. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235953
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-242-0/+62
| | | | | | | | | | | | | | | | | Introduce a (for now copied stripped down) in6_cksum_pseudo() function. We should be able to use this from in6_cksum() but we should also ponder possible MD specific improvements. It takes an extra csum argument to allow for easy checks as will be done by the upper layer protocol input paths. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235924
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-241-31/+27
| | | | | | | | | | | | | | | | Optimize in6_cksum(), re-ordering work and limiting variable initialization, removing a bzero() for mostly re-initialized struct values, making use of the newly introduced in6_getscope(), as well as converting an if/panic to a KASSERT(). Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235921
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-242-0/+14
| | | | | | | | | | | | | | | Introduce in6_getscope() to allow more effective checksum computations without the need to copy the address to clear the scope. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235916
* Use consistent text at the begining of the files.Michael Tuexen2012-05-232-9/+7
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=235828
* Rewrite nd6_sysctl_{d,p}rlist() to avoid misaligned accesses to char arraysMarius Strobl2012-05-201-104/+77
| | | | | | | | | | | | | | | casted to structs by getting rid of these buffers entirely. In r169832, it was tried to paper over this issue by 32-bit aligning the buffers. Depending on compiler optimizations that still was insufficient for 64-bit architectures with strong alignment requirements though. While at it, add comments regarding the total lack of locking in this area. Tested by: bz Reviewed by: bz (slightly earlier version), yongari (earlier version) MFC after: 1 week Notes: svn path=/head/; revision=235681
* Missed to commit this in r235414.Michael Tuexen2012-05-131-2/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=235415
* Use ECONNABORTED in cases where the ABORT was sent to the peer.Michael Tuexen2012-05-131-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=235403
* Provide in the association change notification the received ABORT chunkMichael Tuexen2012-05-121-5/+2
| | | | | | | | | if case of SCTP_COMM_LOST or SCTP_CANT_STR_ASSOC as required by RFC 6458. MFC after: 3 days Notes: svn path=/head/; revision=235360
* in6_pcblookup_local() still can return a pcb with NULLGleb Smirnoff2012-03-211-2/+2
| | | | | | | | | | | | inp_socket. To avoid panic, do not dereference inp_socket, but obtain reuse port option from inp_flags2, like this is done after next call to in_pcblookup_local() a few lines down below. Submitted by: rwatson Notes: svn path=/head/; revision=233272
* Clean up, no functional change.Michael Tuexen2012-03-151-3/+3
| | | | | | | MFC after: 3 days. Notes: svn path=/head/; revision=233005
* In nd6_options() ignore the RFC 6106 options completely rather than printingBjoern A. Zeeb2012-03-041-0/+8
| | | | | | | | | | | them if nd6_debug is enabled as unknown. Leave a comment about the RFC4191 option as I am undecided so far. Discussed with: hrs MFC after: 3 days Notes: svn path=/head/; revision=232514
* Allow to configure net.inet6.ip6.{accept_rtadv,no_radr} by the loader tunablesHiroki Sato2012-03-021-0/+2
| | | | | | | | as well because they have to be configured before interface initialization for AF_INET6. Notes: svn path=/head/; revision=232379
* Remove a redundant check.Hiroki Sato2012-03-021-10/+0
| | | | Notes: svn path=/head/; revision=232378
* In selectroute() add a missing fibnum argument to an in6_rtalloc()Bjoern A. Zeeb2012-02-243-11/+10
| | | | | | | | | | | | | | | call in an #if 0 section. In in6_selecthlim() optimize a case where in6p cannot be NULL due to an earlier check. More consistently use u_int instead of int for fibnum function arguments. Sponsored by: Cisco Systems, Inc. MFC after: 3 days Notes: svn path=/head/; revision=232127
* When using flowtable llentrys can outlive the interface with which they're ↵Kip Macy2012-02-231-15/+15
| | | | | | | | | | | | | | associated at which the lle_tbl pointer points to freed memory and the llt_free pointer is no longer valid. Move the free pointer in to the llentry itself and update the initalization sites. MFC after: 2 weeks Notes: svn path=/head/; revision=232054
* Remove two clang warnings.Michael Tuexen2012-02-181-1/+1
| | | | | | | MFC after: 1 month. Notes: svn path=/head/; revision=231895
* Allow to provide a hint to in6_selectsrc() for the interface using theBjoern A. Zeeb2012-02-142-15/+53
| | | | | | | | | | | | | | | | | | | | | return ifnet double pointer. Pass that hint down to in6_selectif() to be used when i) the default FIB is queried and ii) route lookup fails because the network is not present (i.e. someone deleted the connected subnet). This hint should not be generally used from anywhere outside the neighbor discovery code. We just make use of it from nd6_ns_output(). Extend the nd6_na_output() interface by a nd6_na_output_fib() version and pass the FIB number from the NS mbuf on to NA to allow the new mbuf to inherit the FIB tag and a later lookup from ip6_output() to succeed in the aformentioned example case. Provide a wrapper function for the old public interface also used from CARP but mark it with BURN_BRIDGES to cleanup in HEAD after MFC. Sponsored by: Cisco Systems, Inc. Notes: svn path=/projects/multi-fibv6/head/; revision=231671