summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Sync no-argument function declaration and definition by adding (void).naddy2016-03-071-2/+2
| | | | ok mpi@ millert@
* To avoid that the stack manipules the pf statekeys directly, introducebluhm2015-12-031-20/+5
| | | | | | | | | pf_inp_...() lookup, link and unlink functions as an interface. Locking can be added to them later. Remove the first linking at the beginning of tcp_input() and udp_input() as it is not necessary. It will be done later anyway. That code was a relict, from the time before I had added the second linking. Input from mikeb@ and sashan@; OK sashan@
* in6_embedscope() needs to lose some weight. Remove the last argument.claudio2015-09-111-5/+5
| | | | | | | | | In all but two calls NULL is passed and in the other 2 cases the ifp is only used to maybe feed it to in6_selecthlim() to select the hoplimit for the link. Since in6_embedscope() only works on link-local addresses it does not matter what hop limit we select since the destination is directly reachable. OK florian@ mpi@
* It is time to put inet6 on a diet. Use the flensing knife and cut outclaudio2015-09-101-2/+2
| | | | | the 3rd argument of in6_recoverscope() and make it return void. OK dlg@ mikeb@
* Replace sockaddr casts with the proper satosin() or satosin6() calls.bluhm2015-08-141-3/+3
| | | | From David Hill; OK mpi@
* m_freem() can handle NULL, do not check for this condition beforehands.deraadt2015-07-151-14/+7
| | | | ok stsp mpi
* Pass an interface index instead of a pointer to in6_addr2scopeid().mpi2015-07-081-5/+5
| | | | ok millert@
* Get rid of the undocumented & temporary* m_copy() macro added formpi2015-06-301-2/+3
| | | | | | | | compatibility with 4.3BSD in September 1989. *Pick your own definition for "temporary". ok bluhm@, claudio@, dlg@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-5/+5
| | | | | | | | | | | | | | | 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@
* Try harder to avoid (very unlikely) NULL pointer de-ref by tweakingkrw2015-06-051-32/+18
| | | | | | | | code to use sotopf() like tcp_usrreq() does. Also following tcp_usrreq(), put more stuff under splsoftnet. And as a result in-line code in udp_detach() and nuke udp_detach(). Most ideas from and ok mikeb@
* introduce ipsec-id bundles and use them for ipsecflowinfo,markus2015-05-231-3/+3
| | | | | fixes rekeying for l2tp/ipsec against multiple windows clients and saves memory (for many SAs to same peers); feedback and ok mikeb@
* remove unfinished/unused support for socket-attached ipsec-policiesmarkus2015-04-161-26/+1
| | | | ok mikeb
* Remove support for storing credentials and auth information in the kernel.mikeb2015-04-141-13/+1
| | | | | | | | | This code is largely unfinished and is not used for anything. The change leaves identities as only objects referenced by ipsec_ref structure and their handling requires some changes to support more advanced matching of IPsec connections. No objections from reyk and hshoexer, with and OK markus.
* Do not check if the interface index matches the scope when all we wantmpi2015-03-041-18/+3
| | | | | | | | | | | is to clear the damn embedded scope. At this point the receiving interface should not matter and will in the future be cleared to prevent such layer violations. This prevent exporting addresses with embedded scope to userland. Found the hardway by and ok florian@
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* unifdef -USCOPEDROUTING, no object change.mpi2014-11-251-9/+1
|
* Yet more #include de-duplication.krw2014-11-201-4/+1
| | | | ok deraadt@ tedu@
* In TCP and UDP layers do not (ab)use the receiving interface to checkmpi2014-11-201-11/+2
| | | | | | | | | | | for a multicast/broadcast destination address. These checks have already been done in the Ethernet and IP layers and the mbuf(9) should contain all the required information at this point. But since we cannot trust this spaghetti stack, be paranoid and make sure to set the flags in the IP input routines. Use explicit comments, requested by deraadt@. ok claudio@
* To implement transparent relays for connectionless protocols, thebluhm2014-11-091-1/+11
| | | | | | | | | | pf the state has to vanish immediately when the relay closes the socket. To make this work reliably, the linkage between state and socket must be established with the first packet. This packet could be incomming or outgoing. Link the pf state in the socket layer earlier. This makes all tests in /usr/src/regress/sys/net/pf_divert pass. OK henning@
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* Resize the pcb hashtable automatically. The table size will be doubledyasuoka2014-07-121-5/+4
| | | | | | when the number of the hash entries reaches 75% of the table size. ok dlg henning, 'commit in' claudio
* There is a use-after-free somewhere in the code that links the pfbluhm2014-07-111-2/+5
| | | | | | state to the socket pcb. Add an additional assert to narrow down the panics. OK henning@
* repair ramdisk buildsderaadt2014-06-231-2/+2
|
* Fix compile without IPSEC.yasuoka2014-06-231-2/+2
| | | | | Pointed out by Ivan Solonin. ok henning mpi jca
* Don't use varargs for udp_output() and sync the argument order withmpi2014-04-231-17/+10
| | | | | | udp6_output(). ok henning@, reyk@, jca@
* ip_output() using varargs always struck me as bizarre, esp since it's onlyhenning2014-04-211-3/+3
| | | | | | ever used to pass on uint32 (for ipsec). stop that madness and just pass the uint32, 0 in all cases but the two that pass the ipsec flowinfo. ok deraadt reyk guenther
* Invert the signature logic of in{,6}_selectsrc, make them return thejca2014-04-181-7/+4
| | | | | | | | error code and pass the resulting source address back to the caller through a pointer, as suggested by chrisz. This gives us more readable code, and eases the deletion of useless checks in the callers' error path. Add a bunch of "0 -> NULL" conversions, while here. ok chrisz@ mpi@
* Merge in_fixaddr() into in_selectsrc() in order to prepare formpi2014-04-161-7/+23
| | | | | | | IP_SENDSRCADDR support. This reduces the differences with the IPv6 version and kill some comments that are no longer true. ok jca@, chrisz@, mikeb@
* "struct pkthdr" holds a routing table ID, not a routing domain one.mpi2014-04-141-10/+11
| | | | | | | | | | | | | | 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@
* In udp_output() also use the correct source address in case of an unbound socket.chrisz2014-04-071-1/+3
| | | | OK claudio@
* Retire kernel support for SO_DONTROUTE, this time without breakingmpi2014-04-071-3/+3
| | | | | | | | | | | localhost connections. The plan is to always use the routing table for addresses and routes resolutions, so there is no future for an option that wants to bypass it. This option has never been implemented for IPv6 anyway, so let's just remove the IPv4 bits that you weren't aware of. Tested a least by lteo@, guenther@ and chrisz@, ok mikeb@, benno@
* get rid of expensive temporary connect in udp_output().chrisz2014-04-061-25/+23
| | | | | | Also fixes a possible memory leak where m doesn't get freed in bail case. "lets do it like this" claudio@
* revert "Retire kernel support for SO_DONTROUTE" diff, which does bad thingssthen2014-03-281-3/+3
| | | | for localhost connections. discussed with deraadt@
* Retire kernel support for SO_DONTROUTE, since the plan is to alwaysmpi2014-03-271-3/+3
| | | | | | | | use the routing table there's no future for an option that wants to bypass it. This option has never been implemented for IPv6 anyway, so let's just remove the IPv4 bits that you weren't aware of. Tested by florian@, man pages inputs from jmc@, ok benno@
* clearing the _CSUM_IN_OK flags is now utterly pointless, was only done forhenning2014-01-241-4/+2
| | | | statistics sideeffects before. ok lteo naddy
* since the cksum rewrite the counters for hardware checksummed packetshenning2014-01-231-5/+4
| | | | | | | | | | are are lie, since the software engine emulates hardware offloading and that is later indistinguishable. so kill the hw cksummed counters. introduce software checksummed packet counters instead. tcp/udp handles ip & ipvshit, ip cksum covered, 6 has no ip layer cksum. as before we still have a miscounting bug for inbound with pf on, to be fixed in the next step. found by, prodding & ok naddy
* Switch inpt_queue from CIRCLEQ to TAILQ. Thus ending use of CIRCLEQkrw2013-12-201-2/+2
| | | | | | | in the base. Ports fixes to follow shortly for the two ports (gkrellm and net-snmp) affected. ok zhuk@ millert@
* Remove unused proc argument in in6_control().mpi2013-11-221-2/+2
| | | | ok henning@, mikeb@
* Put a large chunk of the IPv6 rdomain support in-tree.phessler2013-10-201-7/+11
| | | | | | Still some important missing pieces, and this is not yet enabled. OK bluhm@
* make in_proto_cksum_out not rely on the pseudo header checksum to behenning2013-10-191-13/+3
| | | | | | | | | | already there, just compute it - it's dirt cheap. since that happens very late in ip_output, the rest of the stack doesn't have to care about checksums at all any more, if something needs to be checksummed, just set the flag on the pkthdr mbuf to indicate so. stop pre-computing the pseudo header checksum and incrementally updating it in the tcp and udp stacks. ok lteo florian
* The header file netinet/in_var.h included netinet6/in6_var.h. Thisbluhm2013-10-171-1/+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@
* Import vxlan(4), the virtual extensible local area network tunnelreyk2013-10-131-1/+21
| | | | | | | | | interface. VXLAN is a UDP-based tunnelling protocol for overlaying virtualized layer 2 networks over layer 3 networks. The implementation is based on draft-mahalingam-dutt-dcops-vxlan-04 and has been tested with other implementations in the wild. put it in deraadt@
* In one core dump the pointers to socket, inpcb, tcpcb on the stackbluhm2013-09-061-1/+2
| | | | | | | | | | | | | of tcp_input() and tcp_output() were very inconsistent. Especially the so->so_pcb is NULL which can only happen after the inp has been detached. The whole issue looks similar to the old panic: pool_do_get(inpcbpl): free list modified. http://marc.info/?l=openbsd-bugs&m=132630237316970&w=2 To get more information, add some asserts that guarantee the consistency of the socket, inpcb, tcpcb linking. They should trigger when an inp is taken from the pcb hashes after it has been freed. OK henning@
* Move bridge_broadcast and subsequently all IPsec SPD lookup code outmikeb2013-07-311-6/+2
| | | | | | | | of the IPL_NET. pf_test should be no longer called under IPL_NET as well. The problem became evident after the related issue was brought up by David Hill <dhill at mindcry ! org>. With input from and OK mpi. Tested by David and me.
* Increment udpstat.udps_nosec and tcpstat.tcps_rcvnosec in case packet isyasuoka2013-06-091-1/+2
| | | | | | dropped by IPsec security policy. input from and ok mikeb
* Pass the routing domain to IPv6 pr_ctlinput() like in IPv4.bluhm2013-06-011-2/+2
| | | | OK claudio@
* The function rip6_ctlinput() claims that sa6_src is constant tobluhm2013-05-311-6/+5
| | | | | | | | | | allow the assingment of &sa6_any. But rip6_ctlinput() could not guarantee that as it casted away the const attribute when it passes the pointer to in6_pcbnotify(). Replace sockaddr with const sockaddr_in6 in the in6_pcbnotify() parameters. This reduces the number of casts. Also adjust in6_pcbhashlookup() to handle the const attribute correctly. Input and OK claudio@
* Move an extern declaration into its corresponding header file.mpi2013-05-171-4/+1
|
* Remove various external variable declaration from sources files andmpi2013-04-101-4/+2
| | | | | | | move them to the corresponding header with an appropriate comment if necessary. ok guenther@