summaryrefslogtreecommitdiffstats
path: root/sys (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix white spaces and wrap long lines.bluhm2021-02-011-41/+38
|
* Align the mixed naming for the variables used to reference tomglocker2021-02-014-31/+31
| | | | | | | | | bInterfaceNumber and bAlternateSetting as following: ifaceidx -> ifaceno altidx -> altno Suggested and ok mpi@
* Netlock should be grabbed before pppx_if_find() call in pppxwrite().mvs2021-02-011-3/+5
| | | | | | | Otherwise this `pxi' can be killed by concurrent thread after context switch caused by following netlock. ok yasuoka@
* Remove dummy TUNSIFMODE ioctl(2) call from pppac(4) and npppd(8). Sincemvs2021-02-011-10/+1
| | | | | | OpenBSD 6.7 npppd(8) can't work over tun(4). ok yasuoka@
* ifunit() was fully replaced by if_unit(9) and should go away.mvs2021-02-012-20/+8
| | | | ok bluhm@ dlg@
* change route-to so it sends packets to IPs instead of interfaces.dlg2021-02-013-118/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is a significant (and breaking) reworking of the policy based routing that pf can do. the intention is to make it as easy as nat/rdr to use, and more robust when it's operating. the main reasons for this change are: - route-to, reply-to, and dup-to do not work with pfsync this is because the information about where to route-to is stored in rules, and it is hard to have a ruleset synced between firewalls, and impossible to have them synced 100% of the time. - i can make my boxes panic in certain situations using route-to yeah... - the configuration and syntax for route-to rules are confusing. the argument to route-to and co is an interace name with an optional ip address. there are several problems with this. one is that people tend to think about routing as sending packets to peers by their address, not by the interface they're reachable on. another is that we currently have no way to synchronise interface topology information between firewalls, so using an interface to say where packets go means we can't do failover of these states with pfsync. another is that a change in routing topology means a host may become reachable over a different interface. tying routing policy to interfaces gets in the way of failover and load balancing. this change does the following: - stores the route info in the state instead of the pf rule this allows route-to to keep working when the ruleset changes, and allows route-to info to be sent over pfsync. there's enough spare bits in pfsync messages that the protocol doesnt break. the caveat is that route-to becomes tied to pass rules that create state, like rdr-to and nat-to. - the argument to route-to etc is a destination ip address it's not limited to a next-hop address (thought a next-hop can be a destination address). this allows for the failover and load balancing referred to above. - deprecates the address@interface host syntax in pfctl because routing is done entirely by IPs, the interface is derived from the route lookup, not pf. any attempt to use the @interface syntax will fail now in all contexts. there's enthusiasm from proctor@ jmatthew@ and others ok sashan@ bluhm@
* Spacing.mglocker2021-01-311-2/+2
|
* Add basic support for BCM4378 as found on the Apple M1 SoCs. There's apatrick2021-01-313-3/+12
| | | | little bit more to do though before it can be enabled.
* regenpatrick2021-01-312-2/+7
|
* Add Broadcom BCM4378.patrick2021-01-311-1/+2
|
* satisfy -fno-commonderaadt2021-01-302-4/+4
|
* Abstract octeon board handling a littlevisa2021-01-306-39/+75
| | | | | | | Detect octeon board model in one place, and replace firmware-supplied board_type with an abstract model identifier in driver code. This makes it easier to manage with different products, and board flavours, that happen to use the same model information, such as board_type.
* satisfy -fno-commonderaadt2021-01-302-4/+4
|
* update remaining usb.org URLssthen2021-01-294-12/+12
|
* update usb.org URLssthen2021-01-293-7/+7
|
* update some usb.org URLs following reorganisation, add a new one for updsthen2021-01-296-13/+15
| | | | partly from Alessandro Ricci
* repair declerations to satisfy -fno-commonderaadt2021-01-293-19/+4
| | | | ok kettenis
* Don't rely on USB interfaces being at compliant indices.edd2021-01-291-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When obtaining an interface handle, we currently rely on the device being properly USB compliant, and thus the interface being at the correct index in the interfaces array. However, some devices present their indices incorrectly. For example, the following audio device exposes interfaces 0, 1 and 3, in that order (skipping interface 2 entirely): uaudio2 at uhub4 port 4 configuration 1 interface 3 "E+ Corp. DAC Audio" rev 1.10/0.01 addr 2 uaudio2: class v1, full-speed, async, channels: 2 play, 0 rec, 3 ctls This means that that the audio stream interface (number 3) is not found at the expected index of 2, and this causes looking up the handle to fail. This change makes usbd_device2interface_handle() search for the right interface, instead of assuming it will be at the right index. Although this is a little slower, note that this routine not very frequently called and there are typically not hundreds of interfaces on a typical USB device. This fixes the above E+ Corp device, and one other uaudio device reported broken by a user. With input from, tested by, and OK ratchov@, mglocker@ and kettenis@. Many thanks!
* Use NULL instead of 0 to clear v_socket pointer (which actually clears allclaudio2021-01-291-2/+2
| | | | | of the v_un pointers). OK jsg@ mvs@
* recognise Cortex-A78Cjsg2021-01-291-1/+3
|
* Whitespace.rob2021-01-291-3/+2
|
* bridge(4): convert ifunit() to if_unit(9)mvs2021-01-282-16/+38
| | | | ok bluhm@ sashan@
* trunk(4): convert ifunit to if_unit(9)mvs2021-01-281-9/+21
| | | | ok bluhm@
* bios_memmap[] should not be a commonderaadt2021-01-282-3/+4
| | | | ok kettenis
* Again allow COPTS= to come from the environment again, and don't lose thederaadt2021-01-2814-56/+56
| | | | | SMALL_KERNEL specific variations. ok espie jsg
* tpm(4): fix delay unitscheloha2021-01-281-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tpm(4) has timeout constants in milliseconds, e.g. #define TPM_ACCESS_TMO 2000 /* 2sec */ This is fine. The odd thing is that tpm(4) first converts these timeouts to counts of ticks via tpm_tmotohz() before using DELAY() to busy-wait. DELAY() takes a count of microseconds, which are not equivalent to ticks, so the units are all screwed up. Let's correct this: - Remove tpm_tmotohz(). We're not working with ticks so we don't it. - Multiply the timeouts to match the delay interval. tpm_request_locality() and tpm_getburst() use intervals of 10 microseconds, so multiply the millisecond timeouts by 100. In tpm_waitfor() the delay interval is 1 microsecond, so multiply the millisecond timeout by 1000. - Update the parameter name in tpm_waitfor() to note that we expect a count of milliseconds, not "tries". Discussion: https://marc.info/?l=openbsd-tech&m=160995671326406&w=2 Prompted by kettenis@. Suspend/resume tested by florian@ on an X1 Gen 2. For the record, it looks like this: tpm0 at acpi0 TPM_ addr 0xfed40000/0x5000, device 0x0000104a rev 0x4e Earlier versions of this patch were reviewed by kn@, but the patch became more ambitious when kettenis@ got involved so those reviews are no longer applicable. jcs@ notes (https://marc.info/?l=openbsd-tech&m=160834427630142&w=2) in a related discussion that this driver "sucks" and should be replaced with NetBSD's rewrite. This would get us a cleaner driver with TPM 2.0 support. So there is future work to do here. ok kettenis@
* Show when witness(4) has run out of lock order data entries.visa2021-01-281-2/+14
| | | | | | This makes it clearer why lock order traces are sometimes not displayed. Prompted by a question from, and OK anton@
* Drop tcp_trace() from SMALL_KERNEL builds to make room on amd64 floppyvisa2021-01-282-3/+13
| | | | OK deraadt@
* Be consistent in not using parameter names for function prototypes;mglocker2021-01-281-3/+3
| | | | I've missed two more cases in the previous commit.
* handle "once" rules before letting pfsync defer tx of a packet.dlg2021-01-281-15/+15
| | | | | | | | | | | | | pfsync may want to defer the transmission of a packet. it does this so it can try and get a state over to a peer firewall before a host may send a reply to the peer, which would get dropped cos there's no matching state. i think the once rule processing should happen before that. the state is created from the rule, whether the packet the state is for goes out immediately or not shouldn't matter. ok sashan@
* Rename bNumInterface to bNumInterfaces to fix build on arm64.kurt2021-01-281-2/+2
|
* if the route resolved in pf_route is invalid, generate an icmp error.dlg2021-01-271-1/+10
| | | | | | of course this is limited to the !dup-to case. ok sashan@ bluhm@
* The usb configuration descriptor parameter providing the number ofmglocker2021-01-276-16/+16
| | | | | | available device interfaces is called 'bNumInterfaces'. ok phessler@, thfr@ (who provided the man page diff)
* regenjsg2021-01-272-2/+177
|
* add some more amdgpu devicesjsg2021-01-271-1/+36
|
* Be consistent in not using parameter names for function prototypes.mglocker2021-01-271-5/+5
|
* do better accounting of how many msix interrupts we want to use.dlg2021-01-271-2/+8
| | | | ok jmatthew@
* have pf_route{,6} clear the pf_pdesc mbuf ref early for route-to/reply-to.dlg2021-01-271-5/+3
| | | | | | | | | | | | | | | | pf_route and pf_route6 are called to take over delivery of the packet with route-to and reply-to instead of letting it get processed normally. for the dup-to handling, it copies the mbuf but leaves the original mbuf in place. pf_route takes over the packet by clearing the mbuf pointer in the pf_pdesc struct. this diff moves the clearing of that pointer to the start of the function, rather than checking for dup-to again on the way out of the function. i think this is better because it means that it's more robust in the face of future code changes. even if that's not true, it's still shorter code in a forwarding path. ok sashan@ jmatthew@
* don't run copies of packets made by dup-to through pf_test.dlg2021-01-271-3/+3
| | | | | | | | | | | | | | dup-to is kind of like what you do with a span port, but is a bit more fine grained. it copies packets in a connection out an interface so that connection can be monitored. it doesnt make sense for pf to see the copied packets and try to match or create new states for them either. at best it needs config to stop pf seeing the copies (eg, set skip on $dup_to_tgt_if). at worst it breaks the connections you're monitoring because the states in pf get confused. found while discussing larger route-to changes on tech@. ok bluhm@ sashan@
* kqueue: Fix termination assertvisa2021-01-271-2/+12
| | | | | | | | | | | | When a kqueue file is closed, the kqueue can still have threads scanning it. Consequently, kqueue_terminate() can see scan markers in the event queue. These markers are removed when the scanning threads leave the kqueue. Take this into account when checking the queue's state, to avoid a panic when kqueue is closed from under a thread. OK anton@ Reported-by: syzbot+757c60a2aa1125137cce@syzkaller.appspotmail.com
* Recognize Apple Icestorm cores.kettenis2021-01-261-1/+10
|
* intrmap attribute missing from mcx; ok dlgderaadt2021-01-261-3/+3
|
* We have this sequence in bridge(4) ioctl(2) path:mvs2021-01-254-81/+54
| | | | | | | | | | | | | | | | | | | | ifs = ifunit(req->ifbr_ifsname); if (ifs == NULL) { error = ENOENT; break; } if (ifs->if_bridgeidx != ifp->if_index) { error = ESRCH; break; } bif = bridge_getbif(ifs); This sequence repeats 8 times. Also we don't check value returned by bridge_getbig() before use. Newly introduced bridge_getbig() function replaces this sequence. This not only reduces duplicated code but also makes `bif' dereference safe. ok bluhm@
* Give machdep.c a thorough cleanup that is long overdue.kettenis2021-01-253-101/+65
| | | | ok patrick@
* Resolve data toggle out of sync problem for ugen(4) and uhidev(4) devicesmglocker2021-01-252-2/+92
| | | | | | | | | | on xhci(4) controllers by clearing the interface endpoints before opening the pipes. Tested by Mikolaj Kucharski for ugen(4) and gnezdo@ for uhidev(4), plus myself for both. ok mpi@
* Add the new function usbd_clear_endpoint_feature() which allows to issuemglocker2021-01-252-2/+16
| | | | | | | an UR_CLEAR_FEATURE request on a specific endpoint address without the need to have a pipe open to that endpoint. From NetBSD, ok mpi@
* raise the max number of queues/interrupts to 16, up from 1.dlg2021-01-251-3/+12
| | | | | | | | | jmatthew@ has tried this before, but hrvoje popovski experienced breakage so it wasn't enabled. we've tightened the code up since then so it's time to try again. this diff has been tested by hrvoje popovski and myself ok jmatthew@
* if the rx descriptor reports the rss hash, use it for the mbuf flowid.dlg2021-01-251-2/+10
| | | | ok jmatthew@
* don't lose the M_FLOWID flag if the ipv4 cksum is ok.dlg2021-01-251-2/+2
| | | | | found while poking around with hrvoje popovski yes jmatthew@
* Fix wg(4) ioctl to be able to handle multiple wgpeers.yasuoka2021-01-251-5/+10
| | | | | | Diff from Yuichiro NAITO. ok procter