]> git.ipfire.org Git - thirdparty/iproute2.git/commit
tc: flower: Refactor matching flags to be more user friendly
authorPaul Blakey <paulb@mellanox.com>
Fri, 20 Jan 2017 18:36:45 +0000 (10:36 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 20 Jan 2017 18:36:45 +0000 (10:36 -0800)
commit08f66c80c094eaa5d71abc0395fd114ff919af7a
treea87e60999fc3d79e4e0b885c212fcee67f7f6ad8
parentd1b41236e120d651b454dc1fef3f5afc10fd154f
tc: flower: Refactor matching flags to be more user friendly

Instead of "magic numbers" we can now specify each flag
by name. Prefix of "no"  (e.g nofrag) unsets the flag,
otherwise it wil be set.

Example:
    # add a flower filter that will drop fragmented packets
    tc filter add dev ens4f0 protocol ip parent ffff: \
            flower \
            src_mac e4:1d:2d:fd:8b:01 \
            dst_mac e4:1d:2d:fd:8b:02 \
            indev ens4f0 \
            ip_flags frag \
    action drop

    # add a flower filter that will drop non-fragmented packets
    tc filter add dev ens4f0 protocol ip parent ffff: \
            flower \
            src_mac e4:1d:2d:fd:8b:01 \
            dst_mac e4:1d:2d:fd:8b:02 \
            indev ens4f0 \
            ip_flags nofrag \
    action drop

Fixes: 22a8f019891c ('tc: flower: support matching flags')
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
man/man8/tc-flower.8
tc/f_flower.c