From: Eli Britstein Date: Thu, 14 Nov 2019 12:44:39 +0000 (+0200) Subject: tc: flower: fix newline prints for ct-mark and ct-zone X-Git-Tag: v5.4.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99d5ee8368cfe50ab70c1386d8b83d0cc7624a99;p=thirdparty%2Fiproute2.git tc: flower: fix newline prints for ct-mark and ct-zone Matches of ct-mark and ct-zone were printed all in the same line. Fix that so each ct match is printed in a separate line. Example: $ tc qdisc add dev eth0 ingress $ tc filter add dev eth0 protocol ip parent ffff: prio 1 flower skip_hw \ ct_zone 5 ct_mark 6/0xf action ct commit zone 7 mark 8/0xf drop Before: $ 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 ct_zone 5 ct_mark 6/0xf skip_hw not_in_hw action order 1: ct commit mark 8/0xf zone 7 drop index 1 ref 1 bind 1 installed 31 sec used 31 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 After: $ 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 ct_zone 5 ct_mark 6/0xf skip_hw not_in_hw action order 1: ct commit mark 8/0xf zone 7 drop index 1 ref 1 bind 1 installed 108 sec used 108 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Fixes: c8a494314c40 ("tc: Introduce tc ct action") Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Acked-by: Jiri Pirko Signed-off-by: Stephen Hemminger --- diff --git a/tc/f_flower.c b/tc/f_flower.c index 41b81217e..724577563 100644 --- a/tc/f_flower.c +++ b/tc/f_flower.c @@ -1847,13 +1847,13 @@ static void flower_print_ct_label(struct rtattr *attr, static void flower_print_ct_zone(struct rtattr *attr, struct rtattr *mask_attr) { - print_masked_u16("ct_zone", attr, mask_attr, false); + print_masked_u16("ct_zone", attr, mask_attr, true); } static void flower_print_ct_mark(struct rtattr *attr, struct rtattr *mask_attr) { - print_masked_u32("ct_mark", attr, mask_attr, false); + print_masked_u32("ct_mark", attr, mask_attr, true); } static void flower_print_key_id(const char *name, struct rtattr *attr)