summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_output.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Don't pass a pointer to an uninitialized variable as plenp tokrw2020-06-221-4/+4
| | | | | | | | | | | | ip6_hopopts(). The value is tested and non-zero values could cause a packet to be discarded. Initialize the pointed at variable to 0, tweaking variable names and associated comments. COVERITY 1453098 ok deraadt@ mpi@
* add __func__ to panic() and printf() calls in sys/netinet6/*nayden2019-11-291-4/+4
| | | | ok benno@ mortimer@
* Use mallocarray(9) & put some free(9) sizes for M_IPMOPTS allocations.mpi2019-06-101-6/+4
| | | | ok semarie@, visa@
* Removes the KERNEL_LOCK() from bridge(4)'s output fast-path.mpi2019-04-281-3/+3
| | | | | | | | This redefines the ifp <-> bridge relationship. No lock can be currently used across the multiples contexts where the bridge has tentacles to protect a pointer, use an interface index. Tested by various, ok dlg@, visa@
* For raw IPv6 sockets userland may specify an offset where thebluhm2019-04-231-3/+7
| | | | | | | | checksum field is located. During rip6 input and output make sure that this field is within the packet. The offset my be -1 to disable the feature, otherwise it must be non-negative and aligned. Do a stricter check during setsockopt(2). from FreeBSD; OK claudio@
* Convert more MH_ALIGN() to m_align(). Also switch from m_gethdr/M_GETHDRclaudio2018-12-031-3/+3
| | | | | | calls to m_get/M_GET calls because M_MOVE_PKTHDR() is initialising the pkthdr and so it is not needed when allocation the header. OK bluhm@
* M_LEADINGSPACE() and M_TRAILINGSPACE() are just wrappers forclaudio2018-11-091-3/+3
| | | | | | m_leadingspace() and m_trailingspace(). Convert all callers to call directly the functions and remove the defines. OK krw@, mpi@
* Add per-TDB counters and a new SADB extension to export them tompi2018-08-281-2/+4
| | | | | | userland. Inputs from markus@, ok sthen@
* Introduce ipsec_output_cb() to merge duplicate code and account formpi2018-07-121-2/+6
| | | | | | | | dropped packets in the output path. While here fix a memory leak when compression is not needed w/ IPcomp. ok markus@
* Use memcpy instead of bcopy when the memory does not overlap.dhill2018-03-271-3/+3
| | | | OK deraadt@ florian@
* In ip6_output() check that the interface of a route is valid. Forbluhm2018-03-211-1/+12
| | | | | | IPv4 we do the same and there are races that triggers it. Increment the statistics counter for both. from markus@; OK mpi@
* Consistently spell "IPsec" in comments and debug outputs.mpi2018-03-161-2/+2
| | | | From Raf Czlonka, ok sthen@
* Remove almost unused `flags' argument of suser().mpi2018-02-191-8/+8
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* add an ipv6 "don't fragment" flag to mbufs for ip6_output to use.dlg2018-02-111-2/+5
| | | | | | | | | | if you need to send an ipv6 packet with ip6_send(), there's no DF bit in an ipv6 packet and no way to pass the ip6 options to ip6_output to tell it to not allow fragmentation. this adds an M_IPV6_DF_OUT "checksum" flag so something creating ipv6 packets a long way from ip6_output can easily tell it to not allow fragmentation. grumbling and ok claudio@
* Change sosetopt() to no longer free the mbuf it receives and changempi2017-09-011-13/+3
| | | | | | all the callers to call m_freem(9). Support from deraadt@ and tedu@, ok visa@, bluhm@
* Kill commented out code referencing pfctlinput2() and a wrong commentmpi2017-05-091-10/+1
| | | | | | about pfctlinput(PRC_HOSTDEAD). ok bluhm@
* Remove icmp6_reflect() micro optimization to simplify code and avoid arzalamena2017-05-081-9/+1
| | | | | | M_LOOP flag dance in ip6_output(). ok bluhm@, mpi@
* Added initial IPv6 multicast routing support for multiple rdomains:rzalamena2017-05-081-2/+2
| | | | | | | | * don't share mifs (multicast interface) between rdomains * allow multiple routing sockets connected at the same time if they are in different rdomains. ok bluhm@
* Change the ip6_setmoptions() function to receive the rdomain as a newrzalamena2017-05-031-6/+6
| | | | | | | | parameter. This makes the ip6_setmoptions() function look more like the ipv4 version and fixes a problem with IPV6_JOIN_GROUP when no interface is specified. ok bluhm@
* Use the rt_rmx defines that hide the struct rt_kmetrics indirection.bluhm2017-04-191-6/+6
| | | | | No binary change. OK mpi@
* In ip6_ctloutput, check for an invalid level early like the otherdhill2017-02-211-432/+432
| | | | | | *ctloutput functions. This also reduces a level of indentation. ok mpi@
* percpu counters for TCP statsjca2017-02-091-2/+2
| | | | ok mpi@ bluhm@
* 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@
* In sogetopt, preallocate an mbuf to avoid using sleeping mallocs withdhill2017-02-011-31/+17
| | | | | | | | the netlock held. This also changes the prototypes of the *ctloutput functions to take an mbuf instead of an mbuf pointer. help, guidance from bluhm@ and mpi@ ok bluhm@
* copypktopts is only called by ip6_setpktopts using M_NOWAIT. Dropdhill2017-01-271-7/+7
| | | | | | canwait as it is unneeded. ok mpi@
* RFC 8021 "IPv6 Atomic Fragments Considered Harmful" deprecatesbluhm2017-01-191-33/+10
| | | | | | generating atomic fragments. So remove the code that sends them. CVE-2016-10142 has been assigned to that issue. OK visa@ mpi@
* Do not use a 'struct route_in6' when there's no need to cache the resultmpi2017-01-101-19/+13
| | | | | | of rtalloc(9). ok benno@, lteo@
* Remove NULL checks before m_free(9), it deals with it.mpi2017-01-101-3/+2
| | | | ok bluhm@, kettenis@
* turn ipstat into a set of percpu counters.dlg2016-11-181-2/+2
| | | | | | | | | | | | | each counter is identified by an enum value which correspond to the original members of the udpstat struct. udpstat_inc(udps_foo) replaces udpstat.udps_foo++ for the actual updates. udpstat_inc is a thin wrapper around counters_inc. counters are still returned to userland via the udpstat struct for now. ok mpi@ mikeb@ deraadt@
* Automatically create a default lo(4) interface per rdomain.mpi2016-11-141-2/+2
| | | | | | | | | | | | | | | | | | In order to stop abusing lo0 for all rdomains, a new loopback interface will be created every time a rdomain is created. The unit number will be the same as the rdomain, i.e. lo1 will be attached to rdomain 1. If this loopback interface is already in use it wont be possible to create the corresponding rdomain. In order to know which lo(4) interface is attached to a rdomain, its index is stored in the rtable/rdomain map. This is a long overdue since the introduction of rtable/rdomain. It also fixes a recent regression due to resetting the rdomain of an incoming packet reported by semarie@, Andreas Bartelt and Nils Frohberg. ok claudio@
* convert bcopy to memcpy. from david hill. ok jcatedu2016-09-191-10/+10
|
* Kill ip6_pcbopts, unused since the removal of IPV6_PKTOPTIONSjca2016-09-141-44/+1
| | | | ok mikeb@ mpi@
* Delete dead code and useless parameter.jca2016-09-141-33/+5
| | | | ok vgross@ henning@
* Simplify ip6_getpmtu() to use a 'struct rtentry *' instead of twompi2016-08-251-52/+24
| | | | | | | | 'struct route_in6 *'. This is another little step towards deprecating 'struct route{,_in6}' Inputs from and ok bluhm@
* Sizes for free(9) from David Hill.mpi2016-08-221-3/+3
|
* Unbreak getsockopt(IPV6_MINHOPCOUNT)jca2016-07-011-1/+2
| | | | ok bluhm@
* Implement IPV6_MINHOPCOUNT support.jca2016-06-271-1/+14
| | | | | Useful to implement GTSM support in daemons such as bgpd(8). Diff from 2013 revived by renato@. Input from bluhm@, ok bluhm@ deraadt@
* With the introduction of ip6_output_ipsec_lookup() we didn't exit theflorian2016-06-151-15/+15
| | | | | | | | loop when we worked out that no IPsec is needed which led to a NULL de-ref on the next iteration. Fix this by making the code more similar to the IPv4 case. Found the hard way by me, OK mpi@
* Kill nd6_output(), it doesn't do anything since the resolution logicmpi2016-06-151-3/+4
| | | | | | has been moved to nd6_resolve(). ok visa@, millert@, florian@, sthen@
* Remove sysctl net.inet6.ip6.v6onlyjca2016-05-191-6/+6
| | | | | | | | This sysctl is a no-op, read-only since it was introduced. There are no plans to support IPv4-mapped addresses on OpenBSD, thus this sysctl is meaningless. Noticed by djm@, ok claudio@ mpi@ sthen@ henning@
* Do not allow to change the routing table of a bound socket. Thisbluhm2016-04-291-1/+6
| | | | | | | | | is not intended and will behave unexpectedly if the address is already used in another domain. It did not work anyway, as the PCB ended in the wrong hash bucket after changing the rtable. Fail with EBUSY if the socket is already bound and rehash the PCB if its rtable changes. input claudio@; OK mpi@
* factor out ipsec into ip6_output_ipsec_{lookup,send}(); ok mpi@, naddy@markus2016-04-271-95/+76
|
* Introduce in{,6}_hasmulti(), two functions to check in the hot path ifmpi2016-01-211-5/+3
| | | | | | an interface joined a specific multicast group. ok phessler@, visa@, dlg@
* Prevent a double if_put().mpi2016-01-131-1/+2
| | | | ok mikeb@, bluhm@
* rm unused kernel only IPV6_RECVRTHDRDSTOPTS sockopt. ok deraadt sthentedu2015-12-031-11/+1
|
* Kill the RT_REPORT flag to rtalloc() and stop sending RTM_MISS messagesclaudio2015-12-021-3/+3
| | | | | | for failed route lookups. This is something that was maybe useful in the 90is but in this modern times it is just annoying and nothing expect it anyway. OK mpi@, sthen@
* Use if_get() rather than dereferencing rt_ifp in ip6_getpmtu().mpi2015-11-291-14/+25
| | | | | | | While here fix a NULL dereference introduced by the support for multiple rdomains. It seems that this code path is never run... With input from David Hill, ok florian@
* Store the index of the lo0 interface instead of a pointer to itsmpi2015-11-111-2/+2
| | | | | | | | descriptor. Allow to get rid of two if_ref() in the output paths. ok dlg@
* Remove dead assignments.chl2015-11-031-3/+1
| | | | | | Found by LLVM/Clang Static Analyzer. ok bluhm@ mpi@
* Disable TCP/UDP TX hardware checksumming if an IPv4 packet containsnaddy2015-11-031-3/+5
| | | | | | IP options or if an IPv6 packet contains header extensions. Required by cnmac(4) and a sensible precautionary measure in general. ok visa@, mikeb@