#!/bin/sh # # SPDX-License-Identifier: GPL-2.0-or-later # # fuzzing/fuzz-setup.sh - Rootless network namespace for AFL++ fuzzing # # Creates a user + network namespace (no root required) with AnyIP # routing so the test server intercepts all outbound TCP connections # from passt, regardless of destination IP/port or address family. # # Usage: # fuzzing/fuzz-setup.sh -- afl-fuzz [opts] -- ./passt.fuzz --foreground # # Copyright Red Hat # Author: Anshu Kumari exec unshare --map-root-user --net -- sh -c ' set -e ip link set lo up ip route add local 0.0.0.0/0 dev lo ip -6 route add local ::/0 dev lo exec "$@" ' _ "$@"