ACCF_DNS(9)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 14.5, freebsd 15.1

πŸ’… accf_dns, aka ACCF_DNS(9) β€” bestie edition πŸ’…

okay so this is the ACCF_DNS(9) page from the Kernel Developer's Manual, and it's all about the accf_dns accept filter. slay. ✨

🌸 NAME 🌸

okay so accf_dns β€” buffer incoming DNS requests until the whole first request is present. that's the entire mission, bestie. πŸ’…

✨ SYNOPSIS ✨

Kernel config vibes:

options INET
options ACCEPT_FILTER_DNS

In rc.conf(5):

kld_list="accf_dns"

πŸ¦‹ DESCRIPTION πŸ¦‹

This is a filter to be placed on a socket that will be using accept() to receive incoming connections. no cap. 🫢

It prevents the application from receiving the connected descriptor via accept() until a whole DNS request is available on the socket. It does this by reading the first two bytes of the request, to determine its size, and waiting until the required amount of data is available to be read. lowkey clever, honestly. πŸ‘‘

The ACCEPT_FILTER_DNS kernel option is also a module that can be enabled at runtime via kldload(8) if the INET option has been compiled into the kernel. periodt. πŸ’œ

πŸŽ€ EXAMPLES πŸŽ€

If the accf_dns module is available in the kernel, the following code will enable the DNS accept filter on a socket sok. iconic behavior. 🌟

struct accept_filter_arg afa;

bzero(&afa, sizeof(afa));
strcpy(afa.af_name, "dnsready");
setsockopt(sok, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa));

πŸ”₯ SEE ALSO πŸ”₯

go read the friends, bestie. iykyk. πŸ“šβœ¨

⭐ HISTORY ⭐

The accept filter mechanism was introduced in FreeBSD 4.0. retro but still main character energy. πŸ•°οΈπŸ’«

πŸ’œ AUTHORS πŸ’œ

This manual page and the filter were written by David Malone. ty for your service, king. πŸ«‘πŸ‘‘


with love from the Debian build, dated July 16, 2008 β€” bye bestie! πŸ’–πŸŽ€

πŸ“¦ where this page comes from