]> git.proxmox.com Git - mirror_iproute2.git/commit - tc/p_ip6.c
tc/pedit: Fix wrong pedit ipv6 structure id
authorDmytro Linkin <dmitrolin@mellanox.com>
Wed, 27 Feb 2019 12:10:17 +0000 (12:10 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 1 Mar 2019 19:05:00 +0000 (11:05 -0800)
commit2f103545a5454bcdb3fa3ee9075a1ed5acd7f5f3
tree24d8af496804817d9007c4f56324acda44c59f5e
parentaa5bd6a252ce46ee6757458f08a071aabdae9264
tc/pedit: Fix wrong pedit ipv6 structure id

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>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/p_ip6.c