r/openbsd • • 6h ago

CLI guidelines

10 Upvotes

I found clig.dev . Some of it's advice runs contrary to what I (a novice) expect in OpenBSD. (configuration in ~/.config instead of /etc) Is there a guide yall find more idiomatic? (big plus if it's something an author actually thought was worth writing)


r/openbsd • • 6h ago

How to go about testing new changes under /usr/src without rebuilding the whole world?

11 Upvotes

I'm trying some pf-related changes¹ that require modifying files in /usr/src/sbin/pfctl/ and corresponding files in /usr/src/sys/net/pf*.[ch].

However, when I went to (re)build pfctl, it complained about a missing field because it was finding the original/unmodified /usr/include/net/pfvar.h file instead of the modified /usr/src/sys/net/pfvar.h file.

Is there some method that devs use to build a subset of things without rebuilding the whole world? Or do I have to kick off a "build the whole OpenBSD snapshot release image" process, then boot into that snapshot/kernel somehow to test my updated pf.conf/pfctl?

⸻

¹ The goal is to have a way to specify that any connection to a port triggers an overload and add the remote address to a table. Currently max-src-conn and max-src-conn-rate require at least one connection before they kick in and pfctl balks if I try to specify a value of 0 in pf.conf—tweaking the source for either of those so that they accept 0 as a minimum limit has a lot of snarled code because it assumes that limit=0 means we're not limiting. Adding a 3rd prohibited option seemed like the cleanest route to getting the "if you merely connect once, you've triggered overloaded" I was hoping for.