]> git.ipfire.org Git - thirdparty/iproute2.git/commit
tc: add NLM_F_ECHO support for actions
authorVictor Nogueira <victor@mojatatu.com>
Wed, 24 Jan 2024 15:34:55 +0000 (12:34 -0300)
committerDavid Ahern <dsahern@kernel.org>
Tue, 30 Jan 2024 15:49:12 +0000 (15:49 +0000)
commit071144c0bbb9a95f5c529fd536488cebcc652374
treec76c98df0c7facc5e8d7b8ea7b4466bfcf0269c5
parent139a74134c52a7f96cc7b16a53988097dd2d4175
tc: add NLM_F_ECHO support for actions

This patch adds the -echo flag to tc command line and support for it in
tc actions. If the user specifies this flag for an action command, the
kernel will return the command's result back to user space.
For example:

  tc -echo actions add action mirred egress mirror dev lo

  total acts 0
  Added action
        action order 1: mirred (Egress Mirror to device lo) pipe
        index 10 ref 1 bind 0
        not_in_hw

As illustrated above, the kernel will give us an index of 10

The same can be done for other action commands (replace, change, and
delete). For example:

  tc -echo actions delete action mirred index 10

  total acts 0
  Deleted action
        action order 1: mirred (Egress Mirror to device lo) pipe
        index 10 ref 0 bind 0
        not_in_hw

Signed-off-by: Victor Nogueira <victor@mojatatu.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
man/man8/tc.8
tc/m_action.c
tc/tc.c