summaryrefslogtreecommitdiffstats
path: root/sys/net/switchctl.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Refactor klist insertion and removalvisa2020-12-251-4/+4
| | | | | | | | | | | | Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
* Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp.jan2020-12-121-3/+3
| | | | | | OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
* Abstract the head of knote lists. This allows extending the lists,visa2020-04-071-4/+4
| | | | | | for example, with locking assertions. OK mpi@, anton@
* Replace field f_isfd with field f_flags in struct filterops to allowvisa2020-02-201-3/+3
| | | | | | adding more filter properties without cluttering the struct. OK mpi@, anton@
* Simplify filterops routines where klist_invalidate() is used.visa2020-01-281-12/+1
| | | | | | | | klist_invalidate() detaches knotes from the list and rewires them synchronously so that the original filterops routines do not get called after the invalidation. OK anton@, mpi@
* Use C99 designated initializers with struct filterops. In addition,visa2019-12-311-5/+12
| | | | | | make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
* poll handlers must return a poll(2) revents value, not errno(2) values.reyk2019-12-191-2/+2
| | | | | | | | | Some drivers have returned ENXIO (6) if the device is not available which incorrectly translates into POLLPRI|POLLOUT (2|4) in userland. Change it to POLLERR for now, but it might as well be POLLHUP. OK mpi@
* tsleep(9) -> tsleep_nsec(9)mpi2019-10-161-2/+3
| | | | ok cheloha@, visa@, akoshibe@
* pushing NET_LOCK() further down from if_clone_{create,destroy}()sashan2019-05-121-3/+1
| | | | OK mpi@
* Fix mbuf releated crashes in switch(4). They have been found bybluhm2018-12-281-2/+4
| | | | | | | | | | | | | | syzkaller as pool corruption panic. It is unclear which bug caused what, but it should be better now. - Check M_PKTHDR with assertion before accessing m_pkthdr. - Do not access oh_length without m_pullup(). - After checking if there is space at the end of the mbuf, don't overwrite the data at the beginning. Append the new content. - Do not set m_len and m_pkthdr.len when it is unclear whether the ofp_error header fits at all. Use m_makespace() to adjust the mbuf. Reported-by: syzbot+6efc0a9d5b700b54392e@syzkaller.appspotmail.com test akoshibe@; OK claudio@
* M_LEADINGSPACE() and M_TRAILINGSPACE() are just wrappers forclaudio2018-11-091-3/+3
| | | | | | m_leadingspace() and m_trailingspace(). Convert all callers to call directly the functions and remove the defines. OK krw@, mpi@
* Remove NET_LOCK()'s argument.mpi2017-08-111-3/+3
| | | | Tested by Hrvoje Popovski, ok bluhm@
* Fix declaration: vsw_dev2sc has been renamed to switch_dev2sc.reyk2017-01-161-2/+2
|
* Grab the netlock when device is opened; ok mpi, rzalamenamikeb2016-12-221-3/+3
|
* Remove most of the splsoftnet() recursions related to cloned interfaces.mpi2016-12-121-3/+6
| | | | inputs and ok bluhm@
* Remove mutexes protection from the switchctl as they don't seem to berzalamena2016-11-111-10/+1
| | | | | | | doing anything for us, and remove some whitespaces from the header that can be found near the removed lines. ok mikeb@
* Add support for partial writes in switchwrite so we can use multiplerzalamena2016-11-101-24/+81
| | | | | | | write() to write one packet. With this we also get support for writing multiple ofp packets with a single write. ok mikeb@
* Simplify the switchread loop and fix the case where only first mbuf inrzalamena2016-11-091-23/+25
| | | | | | | the chain was being read. While here rename mbuf variable and remove unused ones. ok mikeb@
* Teach switch(4) device read(2) operations to behave like a stream socket,rzalamena2016-11-081-7/+37
| | | | | | | | | so the userland programs can use it without having to do any special treatment (e.g. having to read() whole packets with just 1 call or lose it). This also allows userland to read more than one ofp header/payload with one syscall. ok mikeb@
* When auto-creating an interface when opening a /dev/{tun,tap,switch}reyk2016-09-041-2/+5
| | | | | | | device, inherit the rdomain from the calling process. This adds an rdomain argument to if_clone_create(). OK mpi@ henning@
* Do "goto failed" in case returning EAGAIN as well.yasuoka2016-09-041-3/+3
| | | | ok goda
* Fixed missing null check in switchctl.cgoda2016-09-031-8/+25
| | | | ok yasuoka@
* Import switch(4), an in-kernel OpenFlow switch which can work alone.goda2016-09-011-0/+375
switch(4) currently supports OpenFlow 1.3.5. Currently, it's disabled by the kernel config. With help from yasuoka@ reyk@ jsg@. ok deraadt@ yasuoka@ reyk@ henning@