]> git.ipfire.org Git - thirdparty/iproute2.git/commit
m_mirred: Allow mirred to block
authorVictor Nogueira <victor@mojatatu.com>
Tue, 23 Jan 2024 21:38:11 +0000 (18:38 -0300)
committerDavid Ahern <dsahern@kernel.org>
Thu, 25 Jan 2024 18:15:50 +0000 (18:15 +0000)
commit139a74134c52a7f96cc7b16a53988097dd2d4175
tree8819908e2037ae49a67e9fb52e9ad9e91f3da0a2
parentfbf0acb941507a47e6fbec3eec39500b73c32f53
m_mirred: Allow mirred to block

So far the mirred action has dealt with syntax that handles
mirror/redirection for netdev. A matching packet is redirected or mirrored
to a target netdev.

In this patch we enable mirred to mirror to a tc block as well.
IOW, the new syntax looks as follows:
... mirred <ingress | egress> <mirror | redirect> [index INDEX] < <blockid BLOCKID> | <dev <devname>> >

Examples of mirroring or redirecting to a tc block:
$ tc filter add block 22 protocol ip pref 25 \
  flower dst_ip 192.168.0.0/16 action mirred egress mirror blockid 22

$ tc filter add block 22 protocol ip pref 25 \
  flower dst_ip 10.10.10.10/32 action mirred egress redirect blockid 22

Co-developed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Co-developed-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
man/man8/tc-mirred.8
tc/m_mirred.c