aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladis Dronov <vdronov@redhat.com>2020-01-19 02:12:51 +0100
committerStephen Hemminger <stephen@networkplumber.org>2020-01-20 09:28:39 -0800
commit970db267a0fb5036b28b2d9d4f53cb4be267ffd5 (patch)
tree83310219bc236ff57b82b72c582062935f997ce7
parentd5391e186f04214315a5a80797c78e50ad9f5271 (diff)
downloadiproute2-970db267a0fb5036b28b2d9d4f53cb4be267ffd5.tar.gz
ip: fix link type and vlan oneline output
Move link type printing in print_linkinfo() so multiline output does not break link options line. Add oneline support for vlan's ingress and egress qos maps. Before the fix: 5: veth90.4000@veth90: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 26:9a:05:af:db:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535 vlan protocol 802.1Q id 4000 <REORDER_HDR> the option line is broken ^^^ ingress-qos-map { 1:2 } egress-qos-map { 2:1 } addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 5: veth90.4000@veth90: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\ link/ether 26:9a:05:af:db:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535 \ vlan protocol 802.1Q id 4000 <REORDER_HDR> ingress-qos-map { 1:2 } <<< a multiline output despite -oneline egress-qos-map { 2:1 } addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 After the fix: 5: veth90.4000@veth90: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 26:9a:05:af:db:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 vlan protocol 802.1Q id 4000 <REORDER_HDR> ingress-qos-map { 1:2 } egress-qos-map { 2:1 } 5: veth90.4000@veth90: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\ link/ether 26:9a:05:af:db:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 \ vlan protocol 802.1Q id 4000 <REORDER_HDR> \ ingress-qos-map { 1:2 } \ egress-qos-map { 2:1 } Fixes: 5c302d518f10 ("vlan support") Link: https://bugzilla.kernel.org/show_bug.cgi?id=206241 Reported-by: George Shuklin <george.shuklin@gmail.com> Signed-off-by: Vladis Dronov <vdronov@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r--ip/iplink_vlan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ip/iplink_vlan.c b/ip/iplink_vlan.c
index 0dfb4a8d5..1e6817f5d 100644
--- a/ip/iplink_vlan.c
+++ b/ip/iplink_vlan.c
@@ -183,7 +183,8 @@ static void vlan_print_map(FILE *f,
int rem;
open_json_array(PRINT_JSON, name_json);
- print_string(PRINT_FP, NULL, "\n %s { ", name_fp);
+ print_nl();
+ print_string(PRINT_FP, NULL, " %s { ", name_fp);
rem = RTA_PAYLOAD(attr);
for (i = RTA_DATA(attr); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) {