FRAME sockets added to OpenBSD

Author:
Source

Sponsored:

Atlas of AI: Power, Politics, and the Planetary Costs of Artificial Intelligence - Audiobook


Uncover the true cost of artificial intelligence.

"Atlas of AI" by Kate Crawford exposes how power, politics, and profit extract from our planet, our labor, and our freedom.

From hidden mines to massive data empires, discover how AI is reshaping who we are—and who holds control.

Listen now, and see the system behind the screens before the future listens to you. = > Atlas of AI $0.00 with trial. Read by Larissa Gallagher


Thanks to
work
by David Gwynne (dlg@),
OpenBSD -current now has a new
AF_FRAME
socket domain:

CVSROOT:	/cvs
Module name:	src
Changes by:	dlg@cvs.openbsd.org	2024/12/15 04:00:05

Modified files:
	sys/conf       : files 
	sys/kern       : uipc_domain.c uipc_socket.c 
	sys/net        : if_ethersubr.c 
	sys/sys        : socket.h 
Added files:
	sys/net        : af_frame.c frame.h 

Log message:
add an AF_FRAME socket domain and an IFT_ETHER protocol family under it.

this allows userland to use sockets to send and receive Ethernet
frames. as per the upcoming frame.4 man page:

frame protocol family sockets are designed as an alternative to bpf(4)
for handling low data and packet rate communication protocols.  Rather
than filtering every frame entering the system before the network stack
like bpf(4), the frame protocol family processing avoids this overhead by
running after the built in protocol handlers in the kernel.  For this
reason, it is not possible to handle IPv4 or IPv6 packets with frame
protocol sockets because the kernel network stack consumes them before
the receive handling for frame sockets is run.

if you've used udp sockets then these should feel much the same.

my main motivation is to implement an lldp agent in userland, but
without having to have bpf look at every packet when lldp happens
every minute or two.

the only feedback i had was positive, so i'm putting it in
ok claudio@

There’s been a related change to
aggr(4).

Read more