From: Dmytro Linkin <dmitrolin@mellanox.com>
To: netdev@vger.kernel.org
Cc: Dmytro Linkin <dmitrolin@mellanox.com>
Subject: [iproute2] tc/pedit: Fix wrong pedit ipv6 structure id
Date: Wed, 27 Feb 2019 12:10:17 +0000 [thread overview]
Message-ID: <20190227121017.4244-1-dmitrolin@mellanox.com> (raw)
Tc pedit action with more than two ip6 munge in a row cause infinite
loop.
Example:
$ tc filter add dev eth0 protocol ipv6 parent ffff: \
flower ip_proto sctp \
action pedit ex \
munge ip6 hoplimit set 0x1 \
munge ip6 src set 2001:0db8:0:f101::1 \
munge that cause infinite loop
The example command never returns, instead of failing with parse error
as expected. Pedit ipv6 structure has wrong id, which leads to the
creation linked list with one node in tc/m_pedit.c:get_pedit_kind(),
referring to itself. This node is created if command have two ip6 munge
in a row, and any third ip6 munge will cause infinite loop.
Changing this id from "ipv6" to "ip6" solves the problem.
Fixes: f3e1b2448a95 ("pedit: Introduce ipv6 support")
Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
---
tc/p_ip6.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tc/p_ip6.c b/tc/p_ip6.c
index dbfdca42..7cc7997b 100644
--- a/tc/p_ip6.c
+++ b/tc/p_ip6.c
@@ -84,6 +84,6 @@ done:
}
struct m_pedit_util p_pedit_ip6 = {
- .id = "ipv6",
+ .id = "ip6",
.parse_peopt = parse_ip6,
};
--
2.13.6
reply other threads:[~2019-02-27 12:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190227121017.4244-1-dmitrolin@mellanox.com \
--to=dmitrolin@mellanox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox