#!/bin/sh
# DF-0471 run: load ipfw3 (default-to-accept so ssh survives), run the trigger.
# MUST run as root (raw socket).  On the BUGGY kernel this panics the guest
# (fatal trap 12 in bcopy); on the FIXED kernel ./uflow exits with the
# "[+] kernel correctly rejected short payload (EINVAL)" line.
cd "$(dirname "$0")"
# keep ssh alive: default rule ACCEPT, firewall stays hooked but inert
sysctl net.filters_default_to_accept=1 >/dev/null 2>&1 || true
kldload ipfw3 2>/dev/null || true
echo "=== DF-0471: size_t underflow in ip_fw3_ctl_x (expect PANIC on buggy kernel) ==="
./uflow
echo "uflow_rc=$?"
