Bug 1738633

Summary: invalid json output for ipv6 routes
Product: Red Hat Enterprise Linux 8 Reporter: Patrik Hagara <phagara>
Component: iprouteAssignee: Andrea Claudi <aclaudi>
Status: CLOSED ERRATA QA Contact: Network QE <network-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: atragler
Target Milestone: rc   
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iproute-5.3.0-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:43:46 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:

Description Patrik Hagara 2019-08-07 16:16:24 UTC
Description of problem:

> [root@virt-121 ~]# rpm -qf $(which ip)
> iproute-4.18.0-15.el8.x86_64
> [root@virt-121 ~]# ip -json -6 route
> [{"dst":"::1","dev":"lo","protocol":"kernel","metric":256,"flags":[],"pref":"medium"},{"dst":"2620:52:0:25a4::/64","dev":"ens3","protocol":"ra","metric":100,"flags":[],"pref":"medium"},{"dst":"fe80::/64","dev":"ens3","protocol":"kernel","metric":100,"flags":[],"pref":"medium"},{"dst":"default","protocol":"ra","metric":100,"flags":[],"gateway":"fe80::200:5eff:fe00:201"dev ens3 weight 1 ,"flags":[],"gateway":"fe80::327c:5e00:9e8c:7c61"dev ens3 weight 1 ,"flags":[],"gateway":"fe80::82ac:ac00:9e5e:3661"dev ens3 weight 1 ,"flags":[],"pref":"medium"}]
> [root@virt-121 ~]# ip -json -6 route | jq
> parse error: Invalid numeric literal at line 1, column 374

notice the extra "dev ens3 weight 1" after each gateway IPv6 address

Version-Release number of selected component (if applicable):
iproute-4.18.0-15.el8.x86_64

How reproducible:
always

Steps to Reproduce:
1. ip -json -6 route | jq
2.
3.

Actual results:
invalid json produced

Expected results:
valid json output

Additional info:

Comment 1 Andrea Claudi 2019-10-31 15:10:59 UTC
Fix waiting for upstream approval: https://patchwork.ozlabs.org/patch/1187570/

Comment 2 Andrea Claudi 2019-10-31 16:28:15 UTC
Already fixed in iproute2-next with commit 4ecefff3cf25, will cherry-pick once it gets to master.

Comment 11 errata-xmlrpc 2020-11-04 01:43:46 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 (iproute bug fix and enhancement update), 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:4478