]> git.ipfire.org Git - thirdparty/iproute2.git/commit
tc: flower: fix output for ip tos and ttl
authorEli Britstein <elibr@mellanox.com>
Thu, 14 Nov 2019 12:44:41 +0000 (14:44 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 19 Nov 2019 19:36:05 +0000 (11:36 -0800)
commit9479ec1ed0ff6bccde8f3d0e5470597046bb650d
treebdc5ea39b00317e616e8008604f7efa3d0026e96
parentbb3ee8b313f3bc70ba2ec7d69799cd54f7c82036
tc: flower: fix output for ip tos and ttl

Fix the output for ip tos and ttl to be numbers in JSON format.

Example:
$ tc qdisc add dev eth0 ingress
$ tc filter add dev eth0 protocol ip parent ffff: prio 1 flower skip_hw \
      ip_tos 5/0xf action drop

Non JSON format remains the same:
$ tc 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_tos 5/0xf
  skip_hw
  not_in_hw
        action order 1: gact action drop
         random type none pass val 0
         index 1 ref 1 bind 1

JSON format is changed (partial output):
$ tc -p -j filter show dev eth0 parent ffff:
Before:
        "options": {
            "keys": {
                "ip_tos": "0x5/f",
                ...
After:
        "options": {
            "keys": {
                "ip_tos": 5,
                "ip_tos_mask": 15,
                ...

Fixes: 6ea2c2b1cff6 ("tc: flower: add support for matching on ip tos and ttl")
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: Stephen Hemminger <stephen@networkplumber.org>
tc/f_flower.c