summaryrefslogtreecommitdiffstats
path: root/sys/net/rtsock.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Size for free(9).mpi2017-12-181-15/+14
| | | | From <kshe59 at zoho.eu>
* Spacing from kshe59@zoho.eu.mpi2017-12-131-5/+5
|
* Sizes for free in route_output().mpi2017-12-131-7/+8
| | | | From kshe59@zoho.eu.
* Remove outdated comment and trailing spaces.mpi2017-12-101-9/+3
| | | | From kshe59@zoho.eu
* After inlining of raw_detach we know the sizes for free; pointed outflorian2017-11-031-2/+2
| | | | by & OK mpi, input & OK visa
* use rop->rcb similar like in pfkeyv2_detach(); suggested by visaflorian2017-11-031-7/+2
|
* Inline trivial functions from raw_cb.c and tedu it.florian2017-11-031-4/+18
| | | | Suggested by and OK mpi, OK visa
* Move PRU_DETACH out of pr_usrreq into per proto pr_detachflorian2017-11-021-16/+29
| | | | | | functions to pave way for more fine grained locking. Suggested by, comments & OK mpi
* Reduces the scope of the NET_LOCK() in sysctl(2) path.mpi2017-10-091-3/+7
| | | | | | Exposes per-CPU counters to real parrallelism. ok visa@, bluhm@, jca@
* Replace NET_ASSERT_LOCKED() by soassertlocked() in *_usrreq().mpi2017-09-051-1/+3
| | | | | | Not all of them need the NET_LOCK(). ok bluhm@
* Change sosetopt() to no longer free the mbuf it receives and changempi2017-09-011-8/+3
| | | | | | all the callers to call m_freem(9). Support from deraadt@ and tedu@, ok visa@, bluhm@
* Remove NET_LOCK()'s argument.mpi2017-08-111-4/+3
| | | | Tested by Hrvoje Popovski, ok bluhm@
* Prevent userland to modify RTF_LOCAL route entries.mpi2017-08-101-1/+10
| | | | | | | In particular setting an expiration timer on a route entry which would confuse L2 state machines. ok bluhm@
* Move a sanity check that only makes sense for userland where it belongs.mpi2017-08-021-1/+11
| | | | ok bluhm@, florian@
* Enable mpath support in the Allotment Routing Table (ART) on the ramdisk.florian2017-07-301-7/+1
| | | | OK mpi
* Switch installer to Allotment Routing Table (ART).florian2017-07-301-3/+1
| | | | | | Prompted by a bugreport by naddy that IPv6 autoconfiguration is broken in the installer. OK mpi, "go for it" deraadt
* Add an error argument to rtm_send() instead of rerolling it insidempi2017-07-281-3/+3
| | | | | | rtdeletemsg(). ok bluhm@
* Fix typo in comment, ok deraadt@anton2017-07-261-2/+2
|
* rt_getifa() is only needed for routing commands submited by userland.mpi2017-07-241-2/+123
| | | | | | | | So rename it to rtm_getifa(), move it where it belongs and stop calling it from rtrequest(9). Route entries created by the kernel must always specify the corresponding `ifa'. ok claudio@
* Both PF_ROUTE and PF_KEY need to start to take care of their own PCB listclaudio2017-07-031-55/+58
| | | | | | | to simplify the locking of those lists. For now move the LIST_ENTRY from rawcb into routecb and in the pfkey case a new keycb. Do some cleanup and renaming in the pfkey code but more to come. OK bluhm@ mpi@
* Assert that the corresponding socket is locked when manipulating socketmpi2017-06-261-7/+8
| | | | | | | | | | | | | | | | buffers. This is one step towards unlocking TCP input path. Note that all the functions asserting for the socket lock are not necessarilly MP-safe. All the fields of 'struct socket' aren't protected. Introduce a new kernel-only kqueue hint, NOTE_SUBMIT, to be able to tell when a filter needs to lock the underlying data structures. Logic and name taken from NetBSD. Tested by Hrvoje Popovski. ok claudio@, bluhm@, mikeb@
* Replace rtrequest(RTM_DELETE...) rtrequest_delete() and do not evenmpi2017-06-091-10/+15
| | | | | | | | | try to remove a route from the table if it is and invalid cache. This is a step towards decoupling code dealing with userland and kernel inserted routes. ok bluhm@
* Use the rt_rmx defines that hide the struct rt_kmetrics indirection.bluhm2017-04-191-3/+3
| | | | | No binary change. OK mpi@
* When building counter memory in preparation to copy to userland, alwaysderaadt2017-04-051-2/+3
| | | | | | zero the buffers first. All the current objects appear to be safe, however future changes might introduce structure pads. Discussed with guenther, ok bluhm
* Do not allow to change the gateway of an existing entry if the AFmpi2017-03-161-5/+17
| | | | | | | | family is incorrect. Prevent bgpd(8) to corrupt ARP entries as reported by Joe Holden. ok benno@, claudio@
* Move PRU_ATTACH out of the pr_usrreq functions into pr_attach.claudio2017-03-131-41/+47
| | | | | | | Attach is quite a different thing to the other PRU functions and this should make locking a bit simpler. This also removes the ugly hack on how proto was passed to the attach function. OK bluhm@ and mpi@ on a previous version
* Remove unecessary splsoftnet()/splx() dances.mpi2017-03-091-10/+2
| | | | ok bluhm@, claudio@
* Do not grab the NET_LOCK() for routing sockets operations.mpi2017-03-071-3/+11
| | | | | | | | The only function that need the lock is rtm_output() as it messes with the routing table. So grab the lock there since it is safe to sleep in a process context. ok bluhm@
* Since route_input is no longer part of the protosw struct it is possible toclaudio2017-03-071-15/+14
| | | | | | | pass the socket to it and do the SO_USELOOPBACK check there. This removes a the nasty hack in the output function where the sp_family is set to 0 temporarily. OK bluhm@ mpi@
* Move the guts of route_output() meesing with the routing table in theirmpi2017-03-061-107/+106
| | | | | | own function. ok bluhm@
* Prefix functions dealing with routing messages with 'rtm_' and keepmpi2017-03-061-45/+71
| | | | | | | | | them all in net/rtsock.c. This allows to easily spot which functions are doing a copyout(9) when dealing with the routing midlayer. ok phessler@, bluhm@, dhill@, krw@, claudio@
* Convert the variable argument list of the pr_output functions tobluhm2017-03-031-8/+3
| | | | | fixed parameters. OK mpi@ claudio@ dhill@
* It is allowed to sleep in route_output() as we run in process contextbluhm2017-03-031-19/+5
| | | | | | | and do no critical operations on global structures or per socket. The route entry we are working on is reference counted. Call malloc(9) with M_WAITOK and remove the NULL result checks. OK mpi@
* Implement a new routing message RTM_PROPOSAL that communicateskrw2017-03-021-3/+104
| | | | | | | information that can be used to configure an interface and related network components. ok bluhm@, ok for various older versions mpi@ florian@ claudio@
* Fix a rtentry leak in error path.mpi2017-03-021-12/+7
| | | | ok bluhm@
* Convert domain declarations to C99 initializers.mpi2017-03-021-4/+8
| | | | ok dhill@, florian@, bluhm@
* Use c99 struct initialization with protosw.dhill2017-02-221-6/+10
| | | | | | | This makes it easier to grep for a member, such as .pr_usrreq, and know which functions to review. ok mpi@ bluhm@ jca@
* In sogetopt, preallocate an mbuf to avoid using sleeping mallocs withdhill2017-02-011-8/+5
| | | | | | | | 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@
* Use CTASSERT instead of KASSERT for a few sysctl that use the counters APIjca2017-01-311-2/+2
| | | | ok dlg@ mpi@
* Introduce rt_report() a function that generates a route message from anclaudio2017-01-241-97/+114
| | | | | | | rt_entry. Use this function in the success case of all route commands. Reduce the goto madness in route_output and make the code hopefully a bit easier to read and work with. OK mpi@ bluhm@
* i botched the copyout to ifr->ifr_data in SIOCGIFDATA.dlg2017-01-231-3/+3
| | | | | | | | | | this lets pflogd run again. rename if_data() to if_getdata() while here to make grepping for things less noisy. reported by jsg@ worked through with deraadt@
* merge the ifnet and ifqueue stats together when userland wants them.dlg2017-01-231-3/+3
| | | | | | | | | | | a new if_data() function takes a pointer to ifnet and merges its if_data and ifq statistics. it takes the ifq mutex around the reads of the ifq stats so they get a consistent copy. the ifnet and ifq stats are merged because some parts of the stack still update the ifnet counters. ok visa@ (on an earlier diff) mpi@ claudio@
* Zap some bad whitespace.krw2017-01-231-22/+22
|
* Cleanup error handling. Do not use 'goto flush' early on since the messageclaudio2017-01-221-19/+9
| | | | | | | is actually not syntactically valid, call 'goto fail' instead. Remove unneeded rtable_exists() exists checks since those have been done early on. OK mpi@
* Change route_input to a non-variadic function and just pass the addressclaudio2017-01-211-38/+24
| | | | | | family to it. Simplifies the code and disconnects route_input from protosw. The rouing socket is special so no need to try to work like other protos. With input from bluhm@, OK mpi@
* use per-cpu counters for rtstat.dlg2017-01-201-4/+22
| | | | ok mpi@
* add hooks so we can query the current state of a BFD sessionphessler2017-01-191-19/+20
| | | | | | bfd session details are visible with "route -n get 192.0.2.1 -bfd" OK mpi@ deraadt@ claudio@
* A NET_LOCK() was is missing in tcp_sysctl() which shows up as splbluhm2016-12-201-9/+5
| | | | | | | | | | softnet assert failures. It is better to place the lock into net_sysctl() where all the protocol sysctls are called via pr_sysctl. As calling sysctl(2) is in the slow path, doing fine grained locking has no benefit. Many sysctl cases copy out a struct. Having a lock around that keeps the struct consistent. Put assertions in the protocol sysctls that need it. OK mpi@
* Introduce the NET_LOCK() a rwlock used to serialize accesses to the partsmpi2016-12-191-2/+2
| | | | | | | | | | | of the network stack that are not yet ready to be executed in parallel or where new sleeping points are not possible. This first pass replace all the entry points leading to ip_output(). This is done to not introduce new sleeping points when trying to acquire ART's write lock, needed when a new L2 entry is created via the RT_RESOLVE. Inputs from and ok bluhm@, ok dlg@
* m_free() and m_freem() test for NULL. Simplify callers which had their ownjsg2016-11-291-3/+2
| | | | | | NULL tests. ok mpi@