]> git.ipfire.org Git - thirdparty/iptables.git/commit
xtables-translate: Return non-zero if translation fails
authorPhil Sutter <phil@nwl.cc>
Tue, 10 Mar 2026 16:22:52 +0000 (17:22 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 13 Mar 2026 11:35:14 +0000 (12:35 +0100)
commit781a87c08be51bd874c196e1555073eb7a3cbc09
treeedc6f24ebdf60028daafa83d7f2998479dd92e10
parent5c7377b88a0f6c64133052ce69cdd659bf39564a
xtables-translate: Return non-zero if translation fails

Untranslated parts in output are easily overlooked and also don't disrupt
piping into nft (which is a bad idea to begin with), so make a little
noise if things go sideways:

| # iptables-translate -A FORWARD -m recent --set
| nft # -A FORWARD -m recent --set
| Translation not (fully) implemented

| # cat /tmp/input.ipt
| *filter
| -A FORWARD -s 1.2.3.4
| -A FORWARD -m recent --set
| COMMIT
| # iptables-restore-translate -f /tmp/input.ipt
| # Translated by iptables-restore-translate v1.8.13 on Tue Mar 10 17:29:17 2026
| add table ip filter
| add rule ip filter FORWARD ip saddr 1.2.3.4 counter
| # -t filter -A FORWARD -m recent --set
| iptables-translate-restore: line 3 failed

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Florian Westphal <fw@strlen.de>
iptables/xtables-translate.c