summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_sctp.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2025-07-02 16:20:06 +0200
committerPhil Sutter <phil@nwl.cc>2025-07-04 14:55:59 +0200
commit12e6b5ed65fd91ea413a2e45201289c3d01c4e29 (patch)
treebb895ffe92117b38745be5255ad48344a5a3fd91 /extensions/libxt_sctp.c
parent192c3a6bc18f206895ec5e38812d648ccfe7e281 (diff)
extensions: sctp: Translate bare '-m sctp' match
Just like with TCP and UDP protocol matches, emit a simple 'meta l4proto' match if no specific header detail is to be matched. Note that plain '-m sctp' should be a NOP in kernel, but '-p sctp -m sctp' is not and the translation is deferred to the extension in that case. Keep things stu^Wsimple and translate unconditionally. Reviewed-by: Florian Westphal <fw@strlen.de> Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'extensions/libxt_sctp.c')
-rw-r--r--extensions/libxt_sctp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/extensions/libxt_sctp.c b/extensions/libxt_sctp.c
index e8312f0c..6b002402 100644
--- a/extensions/libxt_sctp.c
+++ b/extensions/libxt_sctp.c
@@ -535,8 +535,10 @@ static int sctp_xlate(struct xt_xlate *xl,
const struct xt_sctp_info *einfo =
(const struct xt_sctp_info *)params->match->data;
- if (!einfo->flags)
- return 0;
+ if (!einfo->flags) {
+ xt_xlate_add(xl, "meta l4proto sctp");
+ return 1;
+ }
if (einfo->flags & XT_SCTP_SRC_PORTS) {
if (einfo->spts[0] != einfo->spts[1])