Login
You're viewing the functional.cafe public feed.
  • Oct 31, 2026, 3:55 PM

    The NetBSD Packet Filter (NPF) has a random block procedure extension. It is more of a network assessment feature.

    procedure “test” {
    rndblock : “mod” 10, “percentage” 30
    }

    Modulo 10 will cause the firewall to drop one in every ten packet.
    Percentage 30 will cause NPF to generate random values from 0 to 10000 and will block the packet if the number generated is in 30 percent or less of 10000.
    This could be very useful to see how your network stack handles packet drops.

    #netbsd #NetBSD

    💬 1🔄 19⭐ 23

Replies

  • 💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • Oct 31, 2026, 5:53 PM

    @joe_netbsd i knew Lua quite well back in the 4.x/5.0 days (where we used it in games programming) and even implemented 5.1 in Java. Though i haven't really touched it for 20 years. Then i started using NetBSD saw that it had Lua pre-installed, and someone said Yeah, it's even in the kernel. Then i just about remembered enough syntax to recognise this filter DSL as Lua. :)

    💬 1🔄 0⭐ 0
  • Oct 31, 2026, 10:25 PM

    @drj oh great. You meant Lua programming language. Great to be bringing back some memories haha.

    💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • Oct 31, 2026, 10:37 PM

    @joe_netbsd No, or... not yet? I have started using NetBDF because of the Linux slop (i actually use macOS daily). I installed NetBSD on a cute 2008 netbook. I've been caretaking the bitmap font edit xmbdfed codeberg.org/drj/xmbdfed and i got it compiling on NetBSD. That's my experience so far.

    💬 1🔄 0⭐ 0
  • Nov 1, 2026, 12:01 AM

    @drj Great to hear!!! I am very sure you’ll enjoy your journey with NetBSD. Don’t hesitate to ping me if you have any questions about our great firewall.

    💬 0🔄 0⭐ 0