Basically cherry-picked iptables dist-git commit 56179d2 ("Enable gating for iptables on rhel10.") and adjusted to ipset.