OpenBSD CVS

CVS log for src/sys/net/bpfdesc.h


[BACK] Up to [local] / src / sys / net

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 9 05:56:58 2023 UTC (15 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.47: +5 -4 lines
Diff to previous 1.47 (colored)

add a timeout between capturing a packet and making the buffer readable.

before this, there were three reasons that a bpf read will finish.

the first is the obvious one: the bpf packet buffer in the kernel
fills up. by default this is about 32k, so if you're only capturing
a small packet packet every few seconds, it can take a long time
for the buffer to fill up before you can read them.

the second is if bpf has been configured to enable immediate mode with
ioctl(BIOCIMMEDIATE). this means that when any packet is written into
the bpf buffer, the buffer is immediately readable. this is fine
if the packet rate is low, but if the packet rate is high you don't
get the benefit of buffering many packets that bpf is supposed to
provide.

the third mechanism is if bpf has been configured with the BIOCSRTIMEOUT
ioctl, which sets a maximum wait time on a bpf read. BIOCSRTIMEOUT
means than a clock starts ticking down when a program (eg pflogd)
reads from bpf. when the clock reaches zero then the read returns
with whatever is in the bpf packet buffer. however, there could be
nothing in the buffer, and the read will still complete.

deraadt@ noticed this behaviour with pflogd. it wants packets logged
by pf to end up on disk in a timely fashion, but it's fine with
tolerating a bit of delay so it can take advantatage of buffering
to amortise the cost of the reads per packet. it currently does
this with BIOCSRTIMEOUT set to half a second, which means it's
always waking up every half second even if there's nothing to log.

this diff adds BIOCSWTIMEOUT, which specifies a timeout from when
bpf first puts a packet in the capture buffer, and when the buffer
becomes readable.

by default this wait timeout is infinite, meaning the buffer has
to be filled before it becomes readable. BIOCSWTIMEOUT can be set
to enable the new functionality. BIOCIMMEDIATE is turned into a
variation of BIOCSWTIMEOUT with the wait time set to 0, ie, wait 0
seconds between when a packet is written to the buffer and when the
buffer becomes readable. combining BIOCSWTIMEOUT and
BIOCIMMEDIATE simplifies the code a lot.

for pflogd, this means if there are no packets to capture, pflogd
won't wake up every half second to do nothing.  however, when a
packet is logged by pf, bpf will wait another half second to see
if any more packets arrive (or the buffer fills up) before the read
fires.

discussed a lot with deraadt@ and sashan@
ok sashan@

Revision 1.47 / (download) - annotate - [select for diffs], Sat Jul 9 12:48:21 2022 UTC (23 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

Unwrap klist from struct selinfo as this code no longer uses selwakeup().

OK jsg@

Revision 1.46 / (download) - annotate - [select for diffs], Thu Mar 17 14:22:03 2022 UTC (2 years, 2 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

Use the refcnt API in bpf.

OK sashan@ bluhm@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jan 21 12:33:14 2021 UTC (3 years, 4 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.44: +1 -2 lines
Diff to previous 1.44 (colored)

let vfs keep track of nonblocking state for us.

ok claudio@ mvs@

Revision 1.44 / (download) - annotate - [select for diffs], Sat Jan 2 02:46:06 2021 UTC (3 years, 5 months ago) by cheloha
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

bpf(4): remove ticks

Change bd_rtout to a uint64_t of nanoseconds.  Update the code in
bpfioctl() and bpfread() accordingly.

Add a local copy of nsecuptime() to make the diff smaller.  This will
need to move to kern_tc.c if/when we have another user elsewhere in
the kernel.

Prompted by mpi@.  With input from dlg@.

ok dlg@ mpi@ visa@

Revision 1.43 / (download) - annotate - [select for diffs], Sat Dec 26 16:30:58 2020 UTC (3 years, 5 months ago) by cheloha
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

bpf(4): bpf_d struct: replace bd_rdStart member with bd_nreaders member

bd_rdStart is strange.  It nominally represents the start of a read(2)
on a given bpf(4) descriptor, but there are several problems with it:

1. If there are multiple readers, the bd_rdStart is not set by subsequent
   readers, so their timeout is screwed up.  The read timeout should really
   be tracked on a per-thread basis in bpfread().

2. We set bd_rdStart for poll(2), select(2), and kevent(2), even though
   that makes no sense.  We should not be setting bd_rdStart in bpfpoll()
   or bpfkqfilter().

3. bd_rdStart is buggy.  If ticks is 0 when the read starts then
   bpf_catchpacket() won't wake up the reader.  This is a problem
   inherent to the design of bd_rdStart: it serves as both a boolean
   and a scalar value, even though 0 is a valid value in the scalar
   range.

So let's replace it with a better struct member.  "bd_nreaders" is a
count of threads sleeping in bpfread().  It is incremented before a
thread goes to sleep in bpfread() and decremented when a thread wakes
up.  If bd_nreaders is greater than zero when we reach bpf_catchpacket()
and fbuf is non-NULL we wake up all readers.

The read timeout, if any, is now tracked locally by the thread in
bpfread().

Unlike bd_rdStart, bpfpoll() and bpfkqfilter() don't touch
bd_nreaders.

Prompted by mpi@.  Basic idea from dlg@.  Lots of input from dlg@.

Tested by dlg@ with tcpdump(8) (blocking read) and flow-collector
(https://github.com/eait-itig/flow-collector, non-blocking read).

ok dlg@

Revision 1.42 / (download) - annotate - [select for diffs], Fri Dec 11 05:00:21 2020 UTC (3 years, 6 months ago) by cheloha
Branch: MAIN
Changes since 1.41: +8 -2 lines
Diff to previous 1.41 (colored)

bpf(4): BIOCGRTIMEOUT, BIOCSRTIMEOUT: protect bd_rtout with bd_mtx

Reading and writing bd_rtout is not an atomic operation, so it needs
to be done under the per-descriptor mutex.

While here, start annotating locking in bpfdesc.h.  There's lots more
to do on this front, but you have to start somewhere.

Tweaked by mpi@.

ok mpi@

Revision 1.41 / (download) - annotate - [select for diffs], Wed May 13 21:34:37 2020 UTC (4 years ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

bpf(4): separate descriptor non-blocking status from read timeout

If you set FIONBIO on a bpf(4) descriptor you enable non-blocking mode
and also clobber any read timeout set for the descriptor.  The reverse
is also true: do BIOCSRTIMEOUT and you'll set a timeout and
simultaneously disable non-blocking status.  The two are mutually
exclusive.

This relationship is undocumented and might cause a bug.  At the
very least it makes reasoning about the code difficult.

This patch adds a new member to bpf_d, bd_rnonblock, to store the
non-blocking status of the descriptor.  The read timeout is still
kept in bd_rtout.

With this in place, non-blocking status and the read timeout can
coexist.  Setting one state does not clear the other, and vice versa.

Separating the two states also clears the way for changing the bpf(4)
read timeout to use the system clock instead of ticks.  More on that
in a later patch.

With insight from dlg@ regarding the purpose of the read timeout.

ok dlg@

Revision 1.40 / (download) - annotate - [select for diffs], Thu Jan 2 16:23:01 2020 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.39: +4 -5 lines
Diff to previous 1.39 (colored)

Switch bpf to use pgsigio(9) and sigio_init(9) instead of handrolling
something with csignal().
OK visa@

Revision 1.38.2.1 / (download) - annotate - [select for diffs], Sun Oct 27 20:01:38 2019 UTC (4 years, 7 months ago) by tb
Branch: OPENBSD_6_6
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored) next main 1.39 (colored)

put bpfdesc reference counting back, revert change introduced in 1.175 as:
BPF: remove redundant reference counting of filedescriptors

Anton@ made problem crystal clear:
I've been looking into a similar bpf panic reported by syzkaller,
which looks somewhat related. The one reported by syzkaller is caused
by issuing ioctl(SIOCIFDESTROY) on the interface which the packet filter
is attached to. This will in turn invoke the following functions
expressed as an inverted stacktrace:
1. bpfsdetach()
2. vdevgone()
3. VOP_REVOKE()
4. vop_generic_revoke()
5. vgonel()
6. vclean(DOCLOSE)
7. VOP_CLOSE()
8. bpfclose()

Note that bpfclose() is called before changing the vnode type. In
bpfclose(), the `struct bpf_d` is immediately removed from the global
bpf_d_list list and might end up sleeping inside taskq_barrier(systq).
Since the bpf file descriptor (fd) is still present and valid, another
thread could perform an ioctl() on the fd only to fault since
bpfilter_lookup() will return NULL. The vnode is not locked in this path
either so it won't end up waiting on the ongoing vclean().

Steps to trigger the similar type of panic are straightforward, let there be
two processes running concurrently:

process A:
while true ; do ifconfig tun0 up ; ifconfig tun0 destroy ; done

process B:
while true ; do tcpdump -i tun0 ; done

panic happens within few secs (Dell PowerEdge 710)

OK @visa, OK @anton

OpenBSD 6.6 errata 001

Revision 1.39 / (download) - annotate - [select for diffs], Mon Oct 21 23:02:05 2019 UTC (4 years, 7 months ago) by sashan
Branch: MAIN
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored)

put bpfdesc reference counting back, revert change introduced in 1.175 as:
    BPF: remove redundant reference counting of filedescriptors

Anton@ made problem crystal clear:
    I've been looking into a similar bpf panic reported by syzkaller,
    which looks somewhat related. The one reported by syzkaller is caused
    by issuing ioctl(SIOCIFDESTROY) on the interface which the packet filter
    is attached to. This will in turn invoke the following functions
    expressed as an inverted stacktrace:
      1. bpfsdetach()
      2. vdevgone()
      3. VOP_REVOKE()
      4. vop_generic_revoke()
      5. vgonel()
      6. vclean(DOCLOSE)
      7. VOP_CLOSE()
      8. bpfclose()

    Note that bpfclose() is called before changing the vnode type. In
    bpfclose(), the `struct bpf_d` is immediately removed from the global
    bpf_d_list list and might end up sleeping inside taskq_barrier(systq).
    Since the bpf file descriptor (fd) is still present and valid, another
    thread could perform an ioctl() on the fd only to fault since
    bpfilter_lookup() will return NULL. The vnode is not locked in this path
    either so it won't end up waiting on the ongoing vclean().

Steps to trigger the similar type of panic are straightforward, let there be
two processes running concurrently:

    process A:
	while true ; do ifconfig tun0 up ; ifconfig tun0 destroy ; done

    process B:
	while true ; do tcpdump -i tun0 ; done

panic happens within few secs (Dell PowerEdge 710)

OK @visa, OK @anton

Revision 1.38 / (download) - annotate - [select for diffs], Sat May 18 12:59:32 2019 UTC (5 years ago) by sashan
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE
Branch point for: OPENBSD_6_6
Changes since 1.37: +1 -2 lines
Diff to previous 1.37 (colored)

BPF: remove redundant reference counting of filedescriptors

OK visa@, OK mpi@

Revision 1.37 / (download) - annotate - [select for diffs], Mon Apr 15 21:55:08 2019 UTC (5 years, 1 month ago) by sashan
Branch: MAIN
Changes since 1.36: +15 -5 lines
Diff to previous 1.36 (colored)

moving BPF to RCU

OK visa@

Revision 1.36 / (download) - annotate - [select for diffs], Wed Jan 24 00:25:17 2018 UTC (6 years, 4 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

add support for bpf on "subsystems", not just network interfaces

bpf assumed that it was being unconditionally attached to network
interfaces, and maintained a pointer to a struct ifnet *. this was
mostly used to get at the name of the interface, which is how
userland asks to be attached to a particular interface. this diff
adds a pointer to the name and uses it instead of the interface
pointer for these lookups. this in turn allows bpf to be attached
to arbitrary subsystems in the kernel which just have to supply a
name rather than an interface pointer. for example, bpf could be
attached to pf_test so you can see what packets are about to be
filtered. mpi@ is using this to look at usb transfers.

bpf still uses the interface pointer for bpfwrite, and for enabling
and disabling promisc. however, these are nopped out for subsystems.

ok mpi@

Revision 1.35 / (download) - annotate - [select for diffs], Tue Jan 24 10:08:30 2017 UTC (7 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

A space here, a space there. Soon we're talking real whitespace
rectification.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Jan 9 19:15:01 2017 UTC (7 years, 5 months ago) by mpi
Branch: MAIN
Changes since 1.33: +5 -3 lines
Diff to previous 1.33 (colored)

Use a mutex to serialize accesses to buffer slots.

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@

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jan 3 19:28:50 2017 UTC (7 years, 5 months ago) by mpi
Branch: MAIN
Changes since 1.32: +2 -4 lines
Diff to previous 1.32 (colored)

Revert previous, there's still a problem with recursive entries in
bpf_mpath_ether().

Problem reported by Hrvoje Popovski.

Revision 1.32 / (download) - annotate - [select for diffs], Mon Jan 2 11:07:31 2017 UTC (7 years, 5 months ago) by mpi
Branch: MAIN
Changes since 1.31: +5 -3 lines
Diff to previous 1.31 (colored)

Use a mutex to serialize accesses to buffer slots.

With this change bpf_catchpacket() no longer need the KERNEL_LOCK().

ok bluhm@, jmatthew@

Revision 1.31 / (download) - annotate - [select for diffs], Mon Aug 22 10:40:36 2016 UTC (7 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

Call csignal() and selwakeup() from a KERNEL_LOCK'd task.

This will allow us make bpf_tap() KERNEL_LOCK() free.

Discussed with dlg@ and input from guenther@

Revision 1.30 / (download) - annotate - [select for diffs], Wed Mar 30 12:33:10 2016 UTC (8 years, 2 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.29: +1 -2 lines
Diff to previous 1.29 (colored)

remove support for BIOCGQUEUE and BIOSGQUEUE

nothing uses them, and the implementation make incorrect assumptions
about mbufs within bpf processing that could lead to some weird
failures.

ok sthen@ deraadt@ mpi@

Revision 1.29 / (download) - annotate - [select for diffs], Thu Dec 3 16:27:32 2015 UTC (8 years, 6 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Use SRPL_HEAD() and SRPL_ENTRY() to be consistent with and allow to
fallback to a SLIST.

ok dlg@, jasper@

Revision 1.28 / (download) - annotate - [select for diffs], Wed Sep 9 11:55:37 2015 UTC (8 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

convert bpf to using an srp list for the list of descriptors.

this replaces the hand rolled list. the code has always used hand
rolled lists, but that gets a bit cumbersome when theyre SRPs.

requested ages ago by mpi@

Revision 1.27 / (download) - annotate - [select for diffs], Tue Sep 1 04:50:27 2015 UTC (8 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored)

reintroduce bpf.c r1.121.

this differs slightly from 1.121 in that it uses the new srp_follow()
to walk the list of descriptors on an interface. this is instead
of interleaving srp_enter() and srp_leave(), which can lead to races
and corruption if you're touching the same SRPs at different IPLs
on the same CPU.

ok deraadt@ jmatthew@

Revision 1.26 / (download) - annotate - [select for diffs], Sun Aug 23 10:14:25 2015 UTC (8 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.25: +4 -4 lines
Diff to previous 1.25 (colored)

back out bpf+srp. its blowing up in a bridge setup.

ill debug this out of the tree.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Aug 16 12:17:16 2015 UTC (8 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.24: +5 -5 lines
Diff to previous 1.24 (colored)

make bpf_mtap mpsafe by using SRPs.

this was originally implemented by jmatthew@ last year, and updated
by us both during s2k15.

there are four data structures that need to be looked after.

the first is the bpf interface itself. it is allocated and freed
at the same time as an actual interface, so if you're able to send
or receive packets, you're able to run bpf on an interface too.
dont need to do any work there.

the second are bpf descriptors. these represent userland attaching
to a bpf interface, so you can have many of them on a single bpf
interface. they were arranged in a singly linked list before. now
the head and next pointers are replaced with SRP pointers and
followed by srp_enter. the list updates are serialised by the kernel
lock.

the third are the bpf filters. there is an inbound and outbound
filter on each bpf descriptor, ann a process can replace them at
any time. the pointers from the descriptor to those is also changed
to be accessed via srp_enter. updates are serialised by the kernel
lock.

the fourth thing is the ring that bpf writes to for userland to
read. there's one of these per descriptor. because these are only
updated when a filter matches (which is hopefully a relatively rare
event), we take the kernel lock to serialise the writes to the ring.

all this together means you can run bpf against a packet without
taking the kernel lock unless you actually caught a packet and need
to send it to userland. even better, you can run bpf in parallel,
so if we ever support multiple rings on a single interface, we can
run bpf on each ring on different cpus safely.

ive hit this pretty hard in production at work (yay dhcrelay) on
myx (which does rx outside the biglock).

ok jmatthew@ mpi@ millert@

Revision 1.24 / (download) - annotate - [select for diffs], Tue Feb 10 00:53:55 2015 UTC (9 years, 4 months ago) by pelikan
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

make bpf(4) able to filter based on a pf(4) queue ID for tcpdump -Q qname

ALTQ version has been on tech@ for years, people were generally ok with it.

ok henning

Revision 1.23 / (download) - annotate - [select for diffs], Sun Oct 5 18:43:56 2014 UTC (9 years, 8 months ago) by lteo
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

fix typo in comment: correspoding -> corresponding

Revision 1.22 / (download) - annotate - [select for diffs], Wed Dec 18 13:40:08 2013 UTC (10 years, 5 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

Revert the *other* part of bpf.c's r1.84. May finally fix RD Thrush's
encounter with "timeout_add: to_ticks (-1) < 0". Pointed out by RD
Thrush.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Nov 12 01:12:09 2013 UTC (10 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

try bpf.c r1.84 again, this time without semantic changes to if statements.

cheers to sthen@ and krw@ for properly dealing with the fallout of my
first commit.

Revision 1.20 / (download) - annotate - [select for diffs], Mon Nov 11 16:21:08 2013 UTC (10 years, 7 months ago) by sthen
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

Revert bpf.c 1.84 / bpfdesc.h 1.19 for now, "panic: timeout_add: to_ticks (-1)
< 0" seen by RD Thrush, http://article.gmane.org/gmane.os.openbsd.bugs/20113
where he has a long-running process using bpf which is active at the time of
panic.  krw@ agrees with reverting for now.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Nov 11 03:06:43 2013 UTC (10 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored)

replace the user of ticks in a condition like "interval + start < ticks"
with "ticks - start > interval" because the latter copes with the ticks
value wrapping.

pointed out by guenther@
ok krw@

Revision 1.18 / (download) - annotate - [select for diffs], Thu Oct 24 11:14:33 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.17: +3 -2 lines
Diff to previous 1.17 (colored)

Move obvious kernel prototypes (and structure's with kernel pointers,
obviously only used in the kernel) behind #ifdef _KERNEL

Revision 1.17 / (download) - annotate - [select for diffs], Sat Mar 25 22:41:47 2006 UTC (18 years, 2 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored)

allow bpf(4) to ignore packets based on their direction (inbound or
outbound), using a new BIOCSDIRFILT ioctl;
guidance, feedback and ok canacar@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Nov 21 18:16:45 2005 UTC (18 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Move contents of sys/select.h to sys/selinfo.h in preparation for a
userland-visible sys/select.h.  Consistent with what Net and Free do.
OK deraadt@, tested with full ports build by naddy@.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Dec 17 15:56:58 2004 UTC (19 years, 5 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

knf cleanup, convert old k&r-style functions to ansi-style for a
consistent style in sys/net/bpf.c.

ok henning@, "looks fine" canacar@

Revision 1.14 / (download) - annotate - [select for diffs], Tue Jun 22 04:04:19 2004 UTC (19 years, 11 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.13: +2 -1 lines
Diff to previous 1.13 (colored)

Add a new "filter drop" flag to bpf and related ioclts.
When enabled, it notifies the calling interface that the packet
matches a bpf filter and should be dropped.
ok henning@ markus@ frantzen@

Revision 1.5.4.6 / (download) - annotate - [select for diffs], Sat Jun 5 23:11:23 2004 UTC (20 years ago) by niklas
Branch: SMP
Changes since 1.5.4.5: +3 -1 lines
Diff to previous 1.5.4.5 (colored) to branchpoint 1.5 (colored) next main 1.6 (colored)

Merge with the trunk

Revision 1.13 / (download) - annotate - [select for diffs], Fri May 28 08:16:23 2004 UTC (20 years ago) by grange
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A
Changes since 1.12: +3 -1 lines
Diff to previous 1.12 (colored)

bpf device cloning.
Now to have more bpf devices just add device nodes in /dev,
no need to recompile kernel anymore.

Code from form@pdp-11.org.ru, some help from markus@.
ok markus@ canacar@ deraadt@

Revision 1.12 / (download) - annotate - [select for diffs], Sat May 8 20:54:13 2004 UTC (20 years, 1 month ago) by canacar
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

reference count bpf descriptors to protect against disappearing interfaces
while asleep in read. ok deraadt@

Revision 1.5.4.5 / (download) - annotate - [select for diffs], Thu Feb 19 10:57:20 2004 UTC (20 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.5.4.4: +5 -3 lines
Diff to previous 1.5.4.4 (colored) to branchpoint 1.5 (colored)

Merge of current from two weeks agointo the SMP branch

Revision 1.11 / (download) - annotate - [select for diffs], Wed Oct 22 18:42:40 2003 UTC (20 years, 7 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.10: +5 -3 lines
Diff to previous 1.10 (colored)

Add locking and write filtering to bpf descriptors.
Locking prevents dangerous ioctls such as changing the
interface and sending signals to be executed by an
unprivileged process. A filter can also be applied
to packets injected through a bpf descriptor.

These features allow programs using bpf descriptors to
safely drop/seperate privileges.

ok frantzen@ henning@ mcbride@

Revision 1.5.4.4 / (download) - annotate - [select for diffs], Sat Jun 7 11:06:06 2003 UTC (21 years ago) by ho
Branch: SMP
Changes since 1.5.4.3: +2 -6 lines
Diff to previous 1.5.4.3 (colored) to branchpoint 1.5 (colored)

Sync SMP branch to -current

Revision 1.10 / (download) - annotate - [select for diffs], Mon Jun 2 23:28:11 2003 UTC (21 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.9: +2 -6 lines
Diff to previous 1.9 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.8.4.1 / (download) - annotate - [select for diffs], Tue Jun 11 03:30:45 2002 UTC (22 years ago) by art
Branch: UBC
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

Sync UBC branch to -current

Revision 1.5.4.3 / (download) - annotate - [select for diffs], Thu Mar 28 14:57:36 2002 UTC (22 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.5.4.2: +2 -2 lines
Diff to previous 1.5.4.2 (colored) to branchpoint 1.5 (colored)

Merge in -current from roughly a week ago

Revision 1.9 / (download) - annotate - [select for diffs], Thu Mar 14 01:27:09 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: UBC_SYNC_B, UBC_SYNC_A, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

First round of __P removal in sys

Revision 1.5.4.2 / (download) - annotate - [select for diffs], Wed Jul 4 10:53:52 2001 UTC (22 years, 11 months ago) by niklas
Branch: SMP
Changes since 1.5.4.1: +7 -3 lines
Diff to previous 1.5.4.1 (colored) to branchpoint 1.5 (colored)

Merge in -current from two days ago in the SMP branch.
As usual with merges, they do not indicate progress, so do not hold
your breath for working SMP, and do not mail me and ask about the
state of it.  It has not changed.  There is work ongoing, but very, very
slowly.  The commit is done in parts as to not lock up the tree in too
big chunks at a time.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jun 9 06:16:37 2001 UTC (23 years ago) by angelos
Branch: MAIN
CVS Tags: UBC_BASE, OPENBSD_3_0_BASE, OPENBSD_3_0
Branch point for: UBC
Changes since 1.7: +6 -3 lines
Diff to previous 1.7 (colored)

By popular demand, protect from multiple inclusion, and fix to use the
same naming style.

Revision 1.7 / (download) - annotate - [select for diffs], Mon May 28 19:51:06 2001 UTC (23 years ago) by dugsong
Branch: MAIN
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

add BIOC[GS]HDRCMPLT ioctl for BPF, to disable overwriting of link level source address in forged frames. from NetBSD. art@ok

Revision 1.5.4.1 / (download) - annotate - [select for diffs], Mon May 14 22:39:59 2001 UTC (23 years, 1 month ago) by niklas
Branch: SMP
Changes since 1.5: +1 -7 lines
Diff to previous 1.5 (colored)

merge in approximately 2.9 into SMP branch

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jun 19 03:00:54 2000 UTC (23 years, 11 months ago) by jason
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.5: +1 -7 lines
Diff to previous 1.5 (colored)

de-#ifdef-ize

Revision 1.5 / (download) - annotate - [select for diffs], Sun Aug 8 00:43:00 1999 UTC (24 years, 10 months ago) by niklas
Branch: MAIN
CVS Tags: kame_19991208, SMP_BASE, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6
Branch point for: SMP
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

Support detaching of network interfaces.  Still work to do in ipf, and
other families than inet.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Jun 26 09:13:13 1998 UTC (25 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

fix bpf select(); from mts@rare.net

Revision 1.3 / (download) - annotate - [select for diffs], Sun Aug 31 20:42:30 1997 UTC (26 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored)

for non-tty TIOCSPGRP/F_SETOWN/FIOSETOWN pgid setting calls, store uid
and euid as well, then deliver them using new csignal() interface
which ensures that pgid setting process is permitted to signal the
pgid process(es). Thanks to newsham@aloha.net for extensive help and
discussion.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Feb 24 13:33:56 1997 UTC (27 years, 3 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.1: +1 -0 lines
Diff to previous 1.1 (colored)

OpenBSD tags + some prototyping police

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:53:05 1995 UTC (28 years, 8 months ago) by deraadt
CVS Tags: netbsd_1_1, OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:53:05 1995 UTC (28 years, 8 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.