RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1588122 - ss(1) doesn't put IPv6 addresses into square brackets (e.g. RFC 4038)
Summary: ss(1) doesn't put IPv6 addresses into square brackets (e.g. RFC 4038)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iproute
Version: 7.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Andrea Claudi
QA Contact: Jaroslav Aster
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-06 17:26 UTC by Robert Scheck
Modified: 2019-08-06 12:54 UTC (History)
9 users (show)

Fixed In Version: iproute-4.11.0-24.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 12:54:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2019:2131 0 None None None 2019-08-06 12:54:48 UTC

Description Robert Scheck 2018-06-06 17:26:18 UTC
Description of problem:
ss(1) doesn't put IPv6 addresses into square brackets (follwoing e.g.
RFC 4038), thus it looks like this:

[root@tux ~]# ss -lpen | grep sshd
tcp   LISTEN   0   128    *:22    *:*   users:(("sshd",pid=1409,fd=3)) ino:26091 sk:ffff8ee040ed0000 <->
tcp   LISTEN   0   128   :::22   :::*   users:(("sshd",pid=1409,fd=4)) ino:26093 sk:ffff8ee046628000 v6only:1 <->
[root@tux ~]# 

However, :::22 is not a valid IPv6 address and just a colon is a bad way
to separate the IPv6 address from the port. This is why e.g. RFC 4038 has
suggestions to put the IPv6 into square brackets, thus [::]:22. For URIs
this is even explicitly specified e.g. in RFC 2732.

In order to achieve a consistent and clear way to distinguish between IPv6
address and port, I would like to see square brackets as well in ss(1).

Don't forget link-local addresses: [fe80::abc:def:abc:def%enp0s31f6]:123

Version-Release number of selected component (if applicable):
iproute-4.11.0-14.el7.x86_64

How reproducible:
Everytime, see above.

Actual results:
ss(1) doesn't put IPv6 addresses into square brackets (e.g. RFC 4038).

Expected results:
ss(1) puts IPv6 addresses into square brackets (e.g. RFC 4038).

Comment 2 Robert Scheck 2018-06-06 17:28:45 UTC
Phil, please clone this bug especially for RHEL 8, given I assume that
this won't be changed for compatibility reasons for RHEL 7, but then we
should start better with RHEL 8.

Cross-filed ticket 02115142 at the Red Hat customer portal.

Comment 3 Jeremy Harris 2018-08-01 11:01:03 UTC
Upstream code already does put numeric IPv6 addresses in brackets, so a backport
would suffice:

git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git

commit aba9c23a6e1cb134840c998df14888dca469a485
Author: Stephen Hemminger <stephen>
Date:   Fri Aug 4 12:02:41 2017 -0700

    ss: enclose IPv6 address in brackets
    
    Based on patch by Lehner Florian <dev>
    
    Adds support for RFC2732 IPv6 address format with brackets.
    
    Signed-off-by: Stephen Hemminger <stephen>

Comment 5 Phil Sutter 2018-08-02 08:29:23 UTC
Hi,

Backporting the requested change shouldn't require much effort. I'm moving this ticket to target RHEL7.7 though, since it's too late for 7.6 y-stream.

Is backporting to RHEL7.5 explicitly required? If so, I guess backporting to both 7.5 and 7.6 z-streams would be needed.

Due to package rebase, requirements are already fulfilled in RHEL8, BTW.

Cheers, Phil

Comment 6 Robert Scheck 2018-08-02 17:37:52 UTC
RHEL 7.7 would be fine, RHEL 7.6 z-stream would be really great (however
not strictly necessary).

Comment 7 Phil Sutter 2018-08-03 09:11:44 UTC
Hi Robert,

(In reply to Robert Scheck from comment #6)
> RHEL 7.7 would be fine, RHEL 7.6 z-stream would be really great (however
> not strictly necessary).

Thanks for your quick feedback. Since there doesn't seem to be an urgent need to get the feature into older RHEL7 releases, I'll limit effort to RHEL7.7 then.

Thanks, Phil

Comment 10 Andrea Claudi 2019-06-12 12:47:45 UTC
An unintended effect of the commit resolving this issue was discovered during testing. Socket previously identified as :::111 are now showed as *:111 and not, as expected, as [::]:111.

This is consistent with the behaviour of newer iproute versions (included in RHEL 8) but not with the one of previous RHEL 7 versions.

Reopening to fix this and be consistent with previous RHEL 7 versions.

Comment 15 errata-xmlrpc 2019-08-06 12:54:26 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/RHEA-2019:2131


Note You need to log in before you can comment on or make changes to this bug.