Bug 1727293

Summary: ip -j route produces non-parsable json output when tcp metrics are used
Product: Red Hat Enterprise Linux 8 Reporter: Andrea Claudi <aclaudi>
Component: iprouteAssignee: Andrea Claudi <aclaudi>
Status: CLOSED ERRATA QA Contact: Jaroslav Aster <jaster>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: atragler
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iproute-5.3.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:43:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1752857    
Bug Blocks:    

Description Andrea Claudi 2019-07-05 12:26:44 UTC
Description of problem:
ip -j route produces non-parsable json output if called on routes with tcp metrics.

Steps to Reproduce:
1. $ ip link add type dummy
2. $ ip route add 192.168.2.0 dev dummy0 metric 100 mtu 1000 rto_min 3
3. $ ip -j route | jq

Actual results:
    parse error: ':' not as part of an object at line 1, column 319

Expected results:
    $ ip -j route | jq
    [
      {
        "dst": "192.168.2.0",
        "dev": "dummy0",
        "scope": "link",
        "metric": 100,
        "flags": [],
        "metrics": [
          {
            "mtu": 1000,
            "rto_min": 3
          }
        ]
      }
    ]

Comment 1 Andrea Claudi 2019-07-10 10:22:54 UTC
Upstream commit to be backported:

commit 89ce8012d71f5689074dc4cbe3db102cbdf76460
Author: Andrea Claudi <aclaudi>
Date:   Mon Jul 8 11:36:42 2019 +0200

    ip-route: fix json formatting for metrics

Comment 6 errata-xmlrpc 2020-04-28 16:43:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1785