#!/bin/sh

# Apply both address-family policies even if one command fails. Report failure
# to systemd when either policy could not be installed.
rc=0

if ! /usr/sbin/iptables -w 10 -P FORWARD DROP; then
    echo "Failed to set IPv4 FORWARD policy to DROP" >&2
    rc=1
fi

if ! /usr/sbin/ip6tables -w 10 -P FORWARD DROP; then
    echo "Failed to set IPv6 FORWARD policy to DROP" >&2
    rc=1
fi

exit "$rc"
