#!/bin/sh
# DF-0739 run — exercises the heap over-read in ip_fw3_ctl_set_get.
#
# PRECONDITIONS (set up by root, acceptable per audit realism rules):
#   sysctl net.filters_default_to_accept=1   # so the firewall doesn't cut ssh
#   kldload ipfw3                            # root loads the firewall module
#
# The trigger itself requires a SOCK_RAW IP socket (SYSCAP_NONET_RAW = root),
# so run as root.  Usage: ./run.sh [readlen]   (default 256)
cd "$(dirname "$0")"
# ensure ipfw3 is loaded (idempotent); default-accept keeps ssh alive
sysctl net.filters_default_to_accept=1 >/dev/null 2>&1 || true
kldload ipfw3 2>/dev/null || true
exec ./df0739 "${1:-256}"
