]> git.proxmox.com Git - mirror_iproute2.git/commit
tc: fix bugs for tcp_flags and ip_attr hex output
authorKeara Leibovitz <kleib@mojatatu.com>
Thu, 26 Jul 2018 13:45:30 +0000 (09:45 -0400)
committerDavid Ahern <dsahern@gmail.com>
Sun, 12 Aug 2018 21:04:00 +0000 (14:04 -0700)
commite8bd395508cead5a81c2bebd9d3705a9e41ea8bc
treefd5993eaefdde6aa04a2e77485657c6fb0e2113d
parenta0bc57e1ef582a6d586e78cb9c1ecd0b83fb472c
tc: fix bugs for tcp_flags and ip_attr hex output

Fix hex output for both the ip_attr and tcp_flags print functions.

Sample usage:

$ $TC qdisc add dev lo ingress
$ $TC filter add dev lo parent ffff: prio 3 proto ip flower ip_tos 0x8/32
$ $TC fitler add dev lo parent ffff: prio 5 proto ip flower ip_proto tcp \
tcp_flags 0x909/f00

$ $TC filter show dev lo parent ffff:

filter protocol ip pref 3 flower chain 0
filter protocol ip pref 3 flower chain 0 handle 0x1
  eth_type ipv4
  ip_tos 0x8/32
  not_in_hw
filter protocol ip pref 5 flower chain 0
filter protocol ip pref 5 flower chain 0 handle 0x1
  eth_type ipv4
  ip_proto tcp
  tcp_flags 0x909/f00
  not_in_hw

$ $TC -j filter show dev lo parent ffff:

[{
    "protocol":"ip",
    "pref":3,
    "kind":"flower",
    "chain":0
},{
    "protocol":"ip",
    "pref":3,
    "kind":"flower",
    "chain":0,
    "options": {
"handle":1,
"keys": {
    "eth_type":"ipv4",
    "ip_tos":"0x8/32"
    },
    "not_in_hw":true
    }
},{
    "protocol":"ip",
    "pref":5,
    "kind":"flower",
    "chain":0
},{
    "protocol":"ip",
    "pref":5,
    "kind":"flower",
    "chain":0,
    "options": {
"handle":1,
"keys": {
    "eth_type":"ipv4",
    "ip_proto":"tcp",
    "tcp_flags":"0x909/f00"
},
"not_in_hw":true
    }
}]

Signed-off-by: Keara Leibovitz <kleib@mojatatu.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
tc/f_flower.c