#!/bin/sh

set -eu

# A mock of ip6tables(8) for the ikvswitch unit tests: it logs its
# arguments to ${IKV_NET_MOCK_LOG} (so tests can assert the v6
# forwarding rules, and that no v6 SNAT was ever emitted) and always
# succeeds. Requires IKV_NET_MOCK_LOG to be set.

: "${IKV_NET_MOCK_LOG:?IKV_NET_MOCK_LOG must be set}"

echo "ip6tables $@" >>"${IKV_NET_MOCK_LOG}"
exit 0
