Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1367071 - "ip macsec help" fails when a macsec module not loaded
Summary: "ip macsec help" fails when a macsec module not loaded
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iproute
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Timothy Redaelli
QA Contact: Jaroslav Aster
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-15 12:24 UTC by Marek Marusic
Modified: 2017-08-01 21:32 UTC (History)
9 users (show)

Fixed In Version: iproute-3.10.0-78.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 21:32:13 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2171 normal SHIPPED_LIVE iproute bug fix and enhancement update 2017-08-01 18:40:13 UTC

Description Marek Marusic 2016-08-15 12:24:22 UTC
Description of problem:
Command "ip macsec help" fails with "RTNETLINK answers: No such file or directory" when a macsec module not loaded.

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

How reproducible:
always

Steps to Reproduce:
1.$ rmmod macsec #only if loaded before
2.$ ip macsec help

Actual results:
$ ip macsec help
RTNETLINK answers: No such file or directory
Error talking to the kernel

Expected results:
When the module is loaded the help is printed as expected.
$ modprobe macsec
$ ip macsec help
Usage: ip macsec add DEV tx sa { 0..3 } [ OPTS ] key ID KEY
       ip macsec set DEV tx sa { 0..3 } [ OPTS ]
       ip macsec del DEV tx sa { 0..3 }
       ip macsec add DEV rx SCI [ on | off ]
       ip macsec set DEV rx SCI [ on | off ]
       ip macsec del DEV rx SCI
       ip macsec add DEV rx SCI sa { 0..3 } [ OPTS ] key ID KEY
       ip macsec set DEV rx SCI sa { 0..3 } [ OPTS ]
       ip macsec del DEV rx SCI sa { 0..3 }
       ip macsec show
       ip macsec show DEV
where  OPTS := [ pn <u32> ] [ on | off ]
       ID   := 128-bit hex string
       KEY  := 128-bit hex string
       SCI  := { sci <u64> | port <u16> address <lladdr> }

Additional info:

Comment 1 Hangbin Liu 2016-08-26 08:44:13 UTC
commit 688f9aa4f24ffac148f6b4127602f10a7837d4ba
Author: Sabrina Dubroca <sd@queasysnail.net>
Date:   Tue Aug 16 16:26:56 2016 +0200

    macsec: show usage even if the module is not available

    Currently, the `ip macsec` command tries to initialize a genl context
    even when we just want to see the help for the command, which doesn't
    require to talk to the kernel at all.

    Delay genl initialization, which can fail if the module isn't loaded,
    until the point where we will actually need it.

    Fixes: b26fc590ce62 ("ip: add MACsec support")
    Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>

Comment 2 Phil Sutter 2016-08-26 16:36:40 UTC
Hi Hangbin,

(In reply to Hangbin Liu from comment #1)
> commit 688f9aa4f24ffac148f6b4127602f10a7837d4ba
> Author: Sabrina Dubroca <sd@queasysnail.net>
> Date:   Tue Aug 16 16:26:56 2016 +0200

Thanks for identifying this!

Cheers, Phil

Comment 3 Timothy Redaelli 2017-02-10 11:53:16 UTC
Backported commits:

commit 2b68cb77cde32f5cba5f984e15fc402758edea76
Author: Sabrina Dubroca <sd@queasysnail.net>
Date:   Tue Aug 16 16:26:55 2016 +0200

    libgenl: introduce genl_init_handle
    
    All users of genl have the same code to open a genl socket and resolve
    the family for their specific protocol.  Introduce a helper to initialize
    the handle, and use it in all the genl code.
    
    Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>

commit 688f9aa4f24ffac148f6b4127602f10a7837d4ba
Author: Sabrina Dubroca <sd@queasysnail.net>
Date:   Tue Aug 16 16:26:56 2016 +0200

    macsec: show usage even if the module is not available

    Currently, the `ip macsec` command tries to initialize a genl context
    even when we just want to see the help for the command, which doesn't
    require to talk to the kernel at all.

    Delay genl initialization, which can fail if the module isn't loaded,
    until the point where we will actually need it.

    Fixes: b26fc590ce62 ("ip: add MACsec support")
    Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>

Comment 4 Phil Sutter 2017-02-21 17:44:40 UTC
Hi Marek,

Do you have capabilities to do the necessary testing for this ticket? If so, could you please give qa_ack+?

Thanks, Phil

Comment 7 errata-xmlrpc 2017-08-01 21:32:13 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-2017:2171


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