summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2017-01-09Use a mutex to serialize accesses to buffer slots.Martin Pieuchot
With this change bpf_catchpacket() no longer need the KERNEL_LOCK(). Tested by Hrvoje Popovski who reported a recursion in the previous attempt. ok bluhm@
2017-01-09pf_purge_thread() needs the NET_LOCK().Martin Pieuchot
ok sashan@, visa@
2017-01-08When if_down() is called, sppp_keepalive() needs a NET_LOCK().Alexander Bluhm
OK visa@ mpi@
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-04As noticed by bluhm@ the netlock is required for the multicast cleanupMike Belopuhov
While here, remove unnecessary splnet's. ok mpi
2017-01-04dont assume setting IFF_UP will succeed.David Gwynne
run a drivers ioctl handler and check if it worked before calling if_up or if_down to report the change. propagate that error up to userland so ifconfig can report what happened. ok mpi@
2017-01-04shuffle the last change slightly.David Gwynne
only check ml_empty the second time if bpf was run and may have filtered the list. only call task_add if mq_enlist worked.
2017-01-04make if_input return early if the mbuf list is empty.David Gwynne
this saves doing wakeups of the softnet thread. ok deraadt@
2017-01-03Revert previous, there's still a problem with recursive entries inMartin Pieuchot
bpf_mpath_ether(). Problem reported by Hrvoje Popovski.
2017-01-03Don't try to reconfigure the multicast group in the detach handler ofReyk Floeter
the multicast interface - simply clear the VXLAN configuration when the associated multicast interface disappears. This fixes some locking and recursion problems. OK mpi@ mikeb@
2017-01-03Do not trash the original SPL level.Martin Pieuchot
Pointed out by and ok jsg@, ok mikeb@
2017-01-03Move the logic for SIOCSETPFLOW in a helper function to help withMartin Pieuchot
upcoming locking. ok visa@, bluhm@
2017-01-02Use a mutex to serialize accesses to buffer slots.Martin Pieuchot
With this change bpf_catchpacket() no longer need the KERNEL_LOCK(). ok bluhm@, jmatthew@
2017-01-02spacingMartin Pieuchot
2017-01-02pppoe_timeout() needs to take the NET_LOCK().Martin Pieuchot
Assert reported and diff tested by semarie@
2017-01-02Grab the NET_LOCK() when setting an IPv6 address, just like it is doneMartin Pieuchot
for IPv4. Assert reported and diff tested by semarie@
2017-01-01Grab the NET_LOCK() in pppdealloc(), prevent an assert reported by stsp@.Martin Pieuchot
ok visa@, bluhm@
2016-12-29In pf_refragment6() use the valid route from pf_route6() insteadAlexander Bluhm
of calling rtalloc() again. OK mpi@
2016-12-29Change NET_LOCK()/NET_UNLOCK() to be simple wrappers aroundMartin Pieuchot
splsoftnet()/splx() until the known issues are fixed. In other words, stop using a rwlock since it creates a deadlock when chrome is used. Issue reported by Dimitris Papastamos and kettenis@ ok visa@
2016-12-29Use __func__ instead of explicit function name in panic messages.Alexander Bluhm
2016-12-28Fix white spaces. No binary change.Alexander Bluhm
2016-12-28In pf_find_state() pkt_sk was set to NULL if pkt_sk->reverse wasAlexander Bluhm
not valid. This did not work as the value of pkt_sk must be used later to establish the link. So discard the packet statekey only if it is invalid itself and use it to establish the reverse link. From Christiano Haesbaert; OK sashan@
2016-12-28Better check for a valid route than for an existing route in pfAlexander Bluhm
route-to by calling rtisvalid(). Make pf_route() and pf_route6() similar and move the rtalloc() call to the same place. OK mpi@
2016-12-23Replace function names with __func__ in debug prints to make grepAlexander Bluhm
happy.
2016-12-23Fix white spaces. No binary change.Alexander Bluhm
2016-12-22Validate the OFP header to make sure it always have a sane size, alsoRafael Zalamena
make sure to not accept anything else outside of the header size boundaries. ok reyk@
2016-12-22Grab the netlock when device is opened; ok mpi, rzalamenaMike Belopuhov
2016-12-21Grab the netlock when opened and closed; ok mpi, rzalamenaMike Belopuhov
2016-12-21Remove the netlock workaround since if_detach is doing it for us now.Mike Belopuhov
ok mpi, bluhm
2016-12-21Generate an IFINFO message when changing the MTU of an interface.Jeremie Courreges-Anglas
Helps route(4) listeners to refresh their knowledge of the MTU of interfaces. Prompted by a diff for ospfd(8) by Remi Locherer, ok claudio@
2016-12-20Grab the netlock during interface attach and detach.Mike Belopuhov
With help from and OK mpi.
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-20Release the NET_LOCK() before calling any socket function since it isMartin Pieuchot
not recursive. This is temporary until all recursions are found and can be addressed in a correct way. With inputs from bluhm@
2016-12-20Kill recursive splsoftnet()/splx() dances in ioctl(2) path.Martin Pieuchot
ok rzalamena@
2016-12-19Stop mentioning splsoftnet() in comments, it's almost history.Martin Pieuchot
2016-12-19Kill useless comment about splsoftnet() which is going away.Martin Pieuchot
2016-12-19Sending keep alive ends up in ip_output(), so it needs the NET_LOCK().Martin Pieuchot
ok bluhm@
2016-12-19Assert that IPL_SOFTNET is needed rather than calling splsoftnet()Martin Pieuchot
recursively. ok bluhm@
2016-12-19Timer sending packets need to grab the NET_LOCK().Martin Pieuchot
ok bluhm@
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-17Insert RTF_CLONED routes at a higher priority than their partent toMartin Pieuchot
prevent a mpath conflict for /32 RTF_CLONING routes. Found the hardway by jsing@ on Google Compute Engine. ok bluhm@, jsing@
2016-12-14Make 'route add default' show a nicer error message if the providedStefan Sperling
gateway is not reachable (e.g. not on a local subnet). ok millert@ mikeb@ mpi@ (and shrugs by jca@)
2016-12-14fix typo (bas->base), "please commit" mikeb@Stuart Henderson
2016-12-13New media types from FreeBSDMike Belopuhov
No objections from deraadt@, OK dlg Thanks to stsp@ who has extended ifm_media field to 64 bits.
2016-12-13make v6 tunnel address handling consider ipv6 scope.David Gwynne
an earlier version of this diff was ok mpi@
2016-12-12Kill recursive splsoftnet().Martin Pieuchot
ok bluhm@
2016-12-12Remove most of the splsoftnet() recursions related to cloned interfaces.Martin Pieuchot
inputs and ok bluhm@
2016-12-06Use the sizeof udphdr not the sizeof a pointer to it in the af-toJonathan Gray
specific part of pf_test_state_icmp(). This worked by accident on LP64 archs as the struct is eight bytes long. ok mikeb@ bluhm@ krw@ jca@
2016-12-05Propagate error type in validation functions that callRafael Zalamena
swofp_validate_action(), because actions have a different class of errors. While there update the error type and error variables type to match the swofp_send_error() prototype.
2016-12-05Remove the flow id from the flow entry struct and the global variable,Rafael Zalamena
since they were not being used and the OpenFlow specification doesn't mention anything about them. ok reyk@