summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_esp.txlate
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2024-02-01 15:47:09 +0100
committerPhil Sutter <phil@nwl.cc>2024-02-02 18:26:14 +0100
commitda13460f05eaee3b92c3b6d0ca2023c5377f4aca (patch)
treeea4313678cd6fe7de8d20ca08196e265741027aa /extensions/libxt_esp.txlate
parenta0e5dad34a6410e4960feb621780c4b06f374477 (diff)
extensions: esp: Save/xlate inverted full ranges
Also add a translation for plain '-m esp' match which depends on the address family: While ip6tables-translate may emit an exthdr exists match, iptables-translate must stick to meta l4proto. Fixes: 6cfa723a83d45 ("extensions: libxt_esp: Add translation to nft") Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'extensions/libxt_esp.txlate')
-rw-r--r--extensions/libxt_esp.txlate8
1 files changed, 4 insertions, 4 deletions
diff --git a/extensions/libxt_esp.txlate b/extensions/libxt_esp.txlate
index 3b1d5718..5e8fb241 100644
--- a/extensions/libxt_esp.txlate
+++ b/extensions/libxt_esp.txlate
@@ -11,13 +11,13 @@ iptables-translate -A INPUT -p 50 -m esp --espspi 500:600 -j DROP
nft 'add rule ip filter INPUT esp spi 500-600 counter drop'
iptables-translate -A INPUT -p 50 -m esp --espspi 0:4294967295 -j DROP
-nft 'add rule ip filter INPUT counter drop'
+nft 'add rule ip filter INPUT meta l4proto esp counter drop'
iptables-translate -A INPUT -p 50 -m esp ! --espspi 0:4294967295 -j DROP
-nft 'add rule ip filter INPUT counter drop'
+nft 'add rule ip filter INPUT esp spi != 0-4294967295 counter drop'
ip6tables-translate -A INPUT -p 50 -m esp --espspi 0:4294967295 -j DROP
-nft 'add rule ip6 filter INPUT counter drop'
+nft 'add rule ip6 filter INPUT exthdr esp exists counter drop'
ip6tables-translate -A INPUT -p 50 -m esp ! --espspi 0:4294967295 -j DROP
-nft 'add rule ip6 filter INPUT counter drop'
+nft 'add rule ip6 filter INPUT esp spi != 0-4294967295 counter drop'