summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_pcb.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Swap faddr/laddr and fport/lport arguments in call to stoeplitz_ipXport().patrick2021-02-111-3/+3
| | | | | | | | | Technically the whole point of the stoeplitz API is that it's symmetric, meaning that the order of addresses and ports doesn't matter and will produce the same hash value. Coverity CID 1501717 ok dlg@
* if stoeplitz is enabled, use it to provide a flowid for tcp packets.dlg2021-01-251-1/+10
| | | | | | | | | | | | | | drivers that implement rss and multiple rings depend on the symmetric toeplitz code, and use it to generate a key that decides with rx ring a packet lands on. if the toeplitz code is enabled, this diff has the pcb and tcp layer use the toeplitz code to generate a flowid for packets they send, which in turn is used to pick a tx ring. because the nic and the stack use the same key, the tx and rx sides end up with the same hash/flowid. at the very least this means that the same rx and tx queue pair on a particular nic are used for both sides of the connection. as the stack becomes more parallel, it will also help keep both sides of the tcp connection processing in the one place.
* add __func__ to panic() and printf() calls in sys/netinet6/*nayden2019-11-291-3/+3
| | | | ok benno@ mortimer@
* in6_setsockaddr and in6_setpeeraddr can't fail, so let them return void.dlg2019-10-171-7/+3
| | | | | | this also brings them in line with the AF_INET equivalents. ok visa@ bluhm@
* Revert the inpcb table mutex commit. It triggers a witness panicbluhm2018-10-041-16/+1
| | | | | | | in raw IP delivery and UDP broadcast loops. There inpcbtable_mtx is held and sorwakeup() is called within the loop. As sowakeup() grabs the kernel lock, we have a lock ordering problem. found by Hrvoje Popovski; OK deraadt@ mpi@
* As a step towards per inpcb or socket locks, remove the net lockbluhm2018-09-201-2/+17
| | | | | | | | | | | | for netstat -a. Introduce a global mutex that protects the tables and hashes for the internet PCBs. To detect detached PCB, set its inp_socket field to NULL. This has to be protected by a per PCB mutex. The protocol pointer has to be protected by the mutex as netstat uses it. Always take the kernel lock in in_pcbnotifyall() and in6_pcbnotify() before the table mutex to avoid lock ordering problems in the notify functions. OK visa@
* Convert inetctlerrmap to u_char like inet6ctlerrmap. That is alsobluhm2018-09-111-25/+1
| | | | | what FreeBSD does. Remove old #if 0 version of inet6ctlerrmap. OK mpi@
* Make the distribution of in_ and in6_ functions in in_pcb.c andbluhm2018-09-111-47/+182
| | | | | | | | | in6_pcb.c consistent, to ease comparing the code. Move all inet6 functions to in6_. Bring functions in both source files in same order. Cleanup the include section. Now in_pcb.c is a superset of in6_pcb.c. The latter contains all the special implementations. Just moving arround, no code change intended. OK mpi@
* Assert that the INP_IPV6 in in6_pcbconnect() is correct. Just callbluhm2018-06-141-1/+3
| | | | | in_pcbconnect() to avoid the address family maze in syn_cache_get(). input claudio@; OK mpi@
* The global zero addresses must not change, mark them constant.bluhm2018-06-071-2/+2
| | | | OK tb@ visa@
* Use variable names for rtable and rdomain consistently in the in_pcbbluhm2018-06-031-3/+4
| | | | | functions. discussed with and OK mpi@ visa@
* Consistently call the inpcb table parameter "table" in in6_pcbnotify().bluhm2018-06-031-3/+3
| | | | OK visa@ mpi@
* Validate sockaddr from userland in central functions. This resultsbluhm2017-08-111-9/+5
| | | | | | | in common checks for unix, inet, inet6 instead of partial checks here and there. Some checks are already done at a higher layer, but better be paranoid with user input. OK claudio@ millert@
* The in_pcbhashlookup() in in_pcbconnect() enforces that the 4 tupelbluhm2017-08-041-5/+13
| | | | | | | | | | | | | of src/dst ip/port is unique for TCP. But if the socket is not bound, the automatic bind by connect happens after the check. If the socket has the SO_REUSEADDR flag, in_pcbbind() may select an existing local port. Then we had two colliding TCP PCBs. This resulted in a packet storm of ACK packets on loopback. The softnet task was constantly holding the netlock and has a high priority, so the system hung. Do the in_pcbhashlookup() again after in_pcbbind(). This creates sporadic "connect: Address already in use" errors instead of a hang. bug report and testing Olivier Antoine; OK mpi@
* Do not check for locally bound mapped addresses in in6_pcbconnect(),bluhm2017-05-131-7/+2
| | | | | this is done during bind(2) in in6_pcbaddrisavail(). OK mpi@
* When the inpcb queue and hash lists are traversed or modified webluhm2017-03-071-1/+3
| | | | | need netlock. Remove the obsolete splnet. OK mpi@
* Commit in6_selectsrc() split again, with missing assignment fixed.vgross2016-08-041-4/+2
|
* Revert in_selectsrc() refactoring, it breaks IPv6.mpi2016-07-221-2/+4
| | | | | | Reported by Heiko on bugs@. ok stsp@, claudio@
* Split in6_selectsrc() into a low-level part and a pcb-level part, andvgross2016-07-201-4/+2
| | | | | | convert in_selectsrc() prototype to match. Ok bluhm@ mpi@.
* Expand IN6_IFF_NOTREADY, ok bluhm@mpi2016-07-051-4/+3
|
* Rename in_pcblookup() to in_pcblookup_local() and change its prototypevgross2016-04-111-5/+3
| | | | | | to get rid of the now useless foreign address and ports parameters. ok mpi@
* Move reserved port checks from in(6)_pcbaddrisavail() to in_pcbbind().vgross2016-04-051-13/+1
| | | | | | Kill old comments while at it. Ok mpi@ bluhm@
* Use in6_pcbhashlookup() in in6_pcbconnect(). We don't need in_pcblookup()vgross2016-03-301-3/+3
| | | | | | broad search and in_pcbconnect() already uses in_pcbhashlookup(). ok bluhm@ mpi@ jca@
* Merge in_pcbbind() and in6_pcbbind(), and change every call tovgross2016-03-231-59/+2
| | | | | | in6_pcbbind() into in_pcbbind(). Ok jca@ mpi@
* Extract in6_pcbaddrisavail() from in6_pcbbind(), and use it whenvgross2016-03-211-91/+102
| | | | | | | checking for source availability in udp6_output(); This time with all the files. Ok jca@ bluhm@
* Revert, missing decl for in6_pcbaddrisavail() breaks kernel build.jca2016-03-201-102/+91
| | | | Spotted by deraadt@
* Extract in6_pcbaddrisavail() from in6_pcbbind(), and use it whenvgross2016-03-191-91/+102
| | | | | | checking for source availability in udp6_output(). Ok jca@ bluhm@
* Add checks on overlapping IPv6 sockets ownershipvgross2016-03-121-2/+11
| | | | ok mpi@ bluhm@
* Fix SO_REUSE* flags effects when binding multicast addresses. Novgross2015-12-181-2/+2
| | | | | | regression observed on avahi. ok benno@
* Move port picking away from in_pcbbind()vgross2015-12-021-76/+4
| | | | ok sthen@
* Ignore Router Advertisment's current hop limit.mpi2015-10-241-6/+2
| | | | | | | | Appart from the usual inet6 axe murdering exercise to keep you fit, this allows us to get rid of a lot of layer violation due to the use of per- ifp variables to store the current hop limit. Imputs from bluhm@, ok phessler@, florian@, bluhm@
* At guenther's suggestion replace dnssocket() with a SOCK_DNS flag onderaadt2015-10-201-5/+1
| | | | | | | | | socket(). Without pledge, all other socket behaviours become permitted, except this one case: connect/send* only works to *:53. In pledge mode, a very few are further restricted. Some backwards compatibility for the dnssocket/dnsconnect calls will remain in the tree temporarily so that people can build through the transition. ok tedu guenther semarie
* Stop checking for RTF_UP directly, call rtisvalid(9) instead.mpi2015-10-191-2/+2
| | | | | | While here add two missing ``rtableid'' checks in in6_selectsrc(). ok bluhm@
* deduplicate in[6]_pcbbind() port scan loop.vgross2015-10-191-47/+27
| | | | ok mpi@
* Add two new system calls: dnssocket() and dnsconnect(). This creates aderaadt2015-10-181-2/+2
| | | | | | | SS_DNS tagged socket which has limited functionality (for example, you cannot accept on them...) The libc resolver will switch to using these, therefore pledge can identify a DNS transaction better. ok tedu guenther kettenis beck and others
* in6_pcbconnect() returns EADDRNOTAVAIL whenvgross2015-10-151-3/+4
| | | | | | | all the ports in the range portfirst .. portlast are in use. ok millert@, mpi@
* Rename tame() to pledge(). This fairly interface has evolved to be morederaadt2015-10-091-4/+4
| | | | | | strict than anticipated. It allows a programmer to pledge/promise/covenant that their program will operate within an easily defined subset of the Unix environment, or it pays the price.
* Remove inpt_lastport from struct inpcbtable, use local variablesvgross2015-09-221-14/+14
| | | | | | in in_pcbbind() and in6_pcbsetport() ok claudio@, with input from David Hill
* Convert _TM_ flags to TAME_ flags, collapsing the entire mappingderaadt2015-09-111-2/+2
| | | | | | layer because the strings select the right options. Mechanical conversion. ok guenther
* Only include <sys/tame.h> in the .c files that need itguenther2015-09-111-1/+2
| | | | ok deraadt@ miod@
* in6_embedscope() needs to lose some weight. Remove the last argument.claudio2015-09-111-3/+3
| | | | | | | | | 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-3/+3
| | | | | the 3rd argument of in6_recoverscope() and make it return void. OK dlg@ mikeb@
* Move to tame(int flags, char *paths[]) API/ABI.deraadt2015-08-221-2/+1
| | | | | | | | | | | | The pathlist is a whitelist of dirs and files; anything else returns ENOENT. Recommendation is to use a narrowly defined list. Also add TAME_FATTR, which permits explicit change operations against "struct stat" fields. Some other TAME_ flags are refined slightly. Not cranking libc now, since nothing commited in base uses this and the timing is uncomfortable for others. Discussed with many; thanks for a few bug fixes from semarie, doug, guenther. ok guenther
* tame(2) is a subsystem which restricts programs into a "reduced featurederaadt2015-07-191-1/+7
| | | | | | operating model". This is the kernel component; various changes should proceed in-tree for a while before userland programs start using it. ok miod, discussions and help from many
* More damned eye searing whitespace. No change to .o files.krw2015-06-081-10/+10
|
* 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
* Misleading comments about splnet().mpi2014-08-211-5/+1
|
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* Do not include <sys/malloc.h> where it is not needed.mpi2014-06-031-2/+1
|