]> git.ipfire.org Git - thirdparty/iproute2.git/commit
tc: flower: support masked port destination and source match
authorEli Britstein <elibr@mellanox.com>
Wed, 20 Nov 2019 12:42:45 +0000 (14:42 +0200)
committerDavid Ahern <dsahern@gmail.com>
Mon, 25 Nov 2019 21:37:08 +0000 (21:37 +0000)
commit482fd40adfe80bdfc4408bd35b988099072e6352
tree8307089573a2d0a75eeb02abd8aa06d6b0348af2
parent75fb816d9f73b1f217bc740200d69c113e10a896
tc: flower: support masked port destination and source match

Extend destination and source port match to support masks, accepting
both decimal and hexadecimal formats.
Also add missing documentation to synopsis in manpage.

$ tc qdisc add dev eth0 ingress
$ tc filter add dev eth0 protocol ip parent ffff: prio 1 flower skip_hw \
      ip_proto tcp dst_port 1234/0xff00 action drop

$ tc -s filter show dev eth0 parent ffff:
filter protocol ip pref 1 flower chain 0
filter protocol ip pref 1 flower chain 0 handle 0x1
  eth_type ipv4
  ip_proto tcp
  dst_port 1234/0xff00
  skip_hw
  not_in_hw
        action order 1: gact action drop
         random type none pass val 0
         index 1 ref 1 bind 1 installed 26 sec used 26 sec
        Action statistics:
        Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
        backlog 0b 0p requeues 0

$ tc -p -j filter show dev eth0 parent ffff:
        "options": {
            "keys": {
                "dst_port": 1234,
                "dst_port_mask": 65280
                ...

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
man/man8/tc-flower.8
tc/f_flower.c