summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2017-02-07The return code of crp_callback is never checked, so it is notAlexander Bluhm
useful to propagate the error. When an error occurs in an asynchronous network path, incrementing a counter is the right thing. There are four places where an error is not accounted, just add a comment for now. OK mpi@ visa@
2017-02-07Release the NET_LOCK() before entering per-driver ioctl() routine.Martin Pieuchot
This prevents a deadlock with the X server and some wireless drivers. The real fix is to take unix domain socket code out of the NET_LOCK(). Issue reported by pirofti@ and ajacoutot@ ok tb@, stsp@, pirofti@
2017-02-05Always allocate counters memory using type M_COUNTERS.Jeremie Courreges-Anglas
This makes the API simpler, and is probably more useful than spreading counters memory other several types, making it harder to track. Prodded by mpi, ok mpi@ stsp@
2017-02-05Use percpu counters for ip6statJeremie Courreges-Anglas
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@
2017-02-04Move the typedefs for in_{addr,port}_t from <sys/types.h> toPhilip Guenther
<netinet/in.h> and <arpa/inet.h> ok and ports test naddy@ (thanks!) ok krw@ beck@ millert@
2017-02-01In sogetopt, preallocate an mbuf to avoid using sleeping mallocs withDavid Hill
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@
2017-01-31Use CTASSERT instead of KASSERT for a few sysctl that use the counters APIJeremie Courreges-Anglas
ok dlg@ mpi@
2017-01-29Change the IPv4 pr_input function to the way IPv6 is implemented,Alexander Bluhm
to get rid of struct ip6protosw and some wrapper functions. It is more consistent to have less different structures. The divert_input functions cannot be called anyway, so remove them. OK visa@ mpi@
2017-01-26Reduce the difference between struct protosw and ip6protosw. TheAlexander Bluhm
IPv4 pr_ctlinput functions did return a void pointer that was always NULL and never used. Make all functions void like in the IPv6 case. OK mpi@
2017-01-25Since raw_input() and route_input() are gone from pr_input, we canAlexander Bluhm
make the variable parameters of the protocol input functions fixed. Also add the proto to make it similar to IPv6. OK mpi@ guenther@ millert@
2017-01-23The function raw_input() has not been called since netiso has beenAlexander Bluhm
removed in 2004. The comment about raw_input() above rip_input() was added in 1981, but it is wrong since 1992. After that it has been copied to rip6_input(). (*pr_input)() is never called with the parameters (mbuf, sockproto, sockaddr, sockaddr). So retire raw_input(). OK guenther@ deraadt@
2017-01-23Flag pseudo-interfaces as such in order to call add_net_randomness()Martin Pieuchot
only once per packet. Fix a regression introduced when if_input() started to be called by every pseudo-driver. ok claudio@, dlg@
2017-01-23Assert for IPL_SOFTNET rather than raising SPL recursively.Martin Pieuchot
ok benno@
2017-01-20Kill recursive splsofnet()/splx() dances.Martin Pieuchot
Tested by Hrvoje Popovski, ok visa@
2017-01-12Clean up multicast files from unused definitions and comments.Rafael Zalamena
ok mpi@
2017-01-11Remove mfc hash tables and use the OpenBSD routing table for multicastRafael Zalamena
routes. Beside the code simplification and removal, we also get to see the multicast routes now in the route(8) utility. ok mpi@
2017-01-10Remove NULL checks before m_free(9), it deals with it.Martin Pieuchot
ok bluhm@, kettenis@
2017-01-09Grab the NET_LOCK() in ipcomp input callback.Visa Hankala
OK mikeb@ mpi@
2017-01-09Grab the NET_LOCK() in various callbacks.Martin Pieuchot
Fix an assert reported by Hrvoje Popovski. ok visa@, mikeb@
2017-01-06Remove the global viftable vector that holds the virtual interfacesRafael Zalamena
configuration and instead use ifnet to store the configuration and counters. With this we can safely use multicast routing daemons on multiple domains without vif id colisions. ok mpi@
2017-01-06Simplify code by removing some old pullup macro, killing some variablesRafael Zalamena
and using m_dup_pkt() instead of m_copym() with max_linkhdr space adjust on packet sending to avoid more mbuf allocations. with input from millert@ and mikeb@, ok mikeb@
2017-01-06Kill various splsoftnet().Martin Pieuchot
ok rzalamena@, visa@
2017-01-05Remove some unnecessary code abstractions and while here remove aRafael Zalamena
splsoftnet. ok mikeb@
2017-01-04convert igmp_stat into per-cpu countersDavid Gwynne
it follows the same pattern used in previous conversions. from Dimitris Papastamos (thank you). ok mpi@
2017-01-03Remove some recursives splsoftnet().Martin Pieuchot
ok visa@, mikeb@
2016-12-26Typo, "more then" -> "more than"Jeremie Courreges-Anglas
2016-12-24Grab the NET_LOCK() before calling ipsp_process_done() as it ends upMartin Pieuchot
in ip_output(). Found the hardway by and ok kettenis@
2016-12-22Remove PIM support from the multicast stack.Rafael Zalamena
ok mpi@
2016-12-21Fix build without PIM defined.Martin Pieuchot
2016-12-21Fix PIM compilation even though it is disabled.Rafael Zalamena
ok bluhm@
2016-12-20A NET_LOCK() was is missing in tcp_sysctl() which shows up as splAlexander Bluhm
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@
2016-12-20Prevent grabing the NET_LOCK() twice in the ioctl(2) and input path.Martin Pieuchot
While here remove two redundant splsoftnet()/splx() dances. inputs and ok bluhm@
2016-12-20Kill recursive splsoftnet()/splx() in tcp_ctloutput().Martin Pieuchot
ok mikeb@, bluhm@
2016-12-20Remove duplicate in_ioctl() prototype, it is in in_var.h now.Alexander Bluhm
2016-12-20Call the multicast timer callback per domain instead of for all domainsRafael Zalamena
this way we save doing big tables walk and iterating tables that we don't need to. ok mpi@
2016-12-20No need for splsoftnet()/splx() dance around a pool_put() if the poolMartin Pieuchot
has IPL_SOFTNET as ipl. ok mikeb@, kettenis@
2016-12-20Remove unused timeout that was never being set.Rafael Zalamena
ok reyk@
2016-12-19Remove redundant splsoftnet().Martin Pieuchot
ok bluhm@
2016-12-19Kill unused function.Rafael Zalamena
ok mpi@
2016-12-19Remove a recursive splsoftnet() in in_ioctl() that already asserts thatMartin Pieuchot
it is called at IPL_SOFTNET.
2016-12-19If rt_ifa_addlocal() in in_ifinit() fails, the address has beenAlexander Bluhm
added to the interface address list, but the local route is missing. This inconsistency could result in a "ifa == rt->rt_ifa" assertion panic later. So in case of a route add error, remove the interface address to get a consistent state again. OK stsp@ mpi@
2016-12-19Extend the multicast sockets and multicast hash table support to multipleRafael Zalamena
domains. This is one step towards supporting to run more than one multicast socket in different domains at the same time. ok mpi@
2016-12-19Introduce the NET_LOCK() a rwlock used to serialize accesses to the partsMartin Pieuchot
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@
2016-12-16Move the if_get/if_put to the caller of igmp_sendpkt so we avoid havingRafael Zalamena
to do this lookup twice. Suggested by and ok mpi@
2016-12-14Set the rtableid for new mbufs when sending packets in igmp_sendpkt().Rafael Zalamena
ok mikeb@, phessler@
2016-12-13Propagate the routing table id in ip_mrouter_set() so the MRT_ADD_VIFRafael Zalamena
calls won't fail anymore when doing from a different rdomain. ok mpi@
2016-12-10Pass the correct offset of the next protocol field for the given IPPatrick Wildt
version to the upper layers. The stack will set this field to IPIP later on, so make sure it doesn't overwrite the packet in the wrong location. ok bluhm@ deraadt@ stsp@
2016-12-05Remove recursive splsoftnet()s in ioctl(2) path.Martin Pieuchot
2016-11-29Kill unused 'struct route'.Martin Pieuchot
2016-11-29m_free() and m_freem() test for NULL. Simplify callers which had their ownJonathan Gray
NULL tests. ok mpi@