|
|
4aca6e |
From 42a4461854ab308ebcebb99df7085e1e896f8fa5 Mon Sep 17 00:00:00 2001
|
|
|
4aca6e |
From: Timothy Redaelli <tredaelli@redhat.com>
|
|
|
4aca6e |
Date: Fri, 10 Feb 2017 12:51:09 +0100
|
|
|
4aca6e |
Subject: [PATCH] macsec: show usage even if the module is not available
|
|
|
4aca6e |
|
|
|
4aca6e |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1367071
|
|
|
4aca6e |
Upstream Status: iproute2.git commit 688f9aa
|
|
|
4aca6e |
|
|
|
4aca6e |
commit 688f9aa4f24ffac148f6b4127602f10a7837d4ba
|
|
|
4aca6e |
Author: Sabrina Dubroca <sd@queasysnail.net>
|
|
|
4aca6e |
Date: Tue Aug 16 16:26:56 2016 +0200
|
|
|
4aca6e |
|
|
|
4aca6e |
macsec: show usage even if the module is not available
|
|
|
4aca6e |
|
|
|
4aca6e |
Currently, the `ip macsec` command tries to initialize a genl context
|
|
|
4aca6e |
even when we just want to see the help for the command, which doesn't
|
|
|
4aca6e |
require to talk to the kernel at all.
|
|
|
4aca6e |
|
|
|
4aca6e |
Delay genl initialization, which can fail if the module isn't loaded,
|
|
|
4aca6e |
until the point where we will actually need it.
|
|
|
4aca6e |
|
|
|
4aca6e |
Fixes: b26fc590ce62 ("ip: add MACsec support")
|
|
|
4aca6e |
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
|
|
|
4aca6e |
|
|
|
4aca6e |
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
|
|
|
4aca6e |
---
|
|
|
4aca6e |
ip/ipmacsec.c | 6 +++---
|
|
|
4aca6e |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
4aca6e |
|
|
|
4aca6e |
diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c
|
|
|
4aca6e |
index f05b27a..127fa1e 100644
|
|
|
4aca6e |
--- a/ip/ipmacsec.c
|
|
|
4aca6e |
+++ b/ip/ipmacsec.c
|
|
|
4aca6e |
@@ -986,15 +986,15 @@ static int do_show(int argc, char **argv)
|
|
|
4aca6e |
|
|
|
4aca6e |
int do_ipmacsec(int argc, char **argv)
|
|
|
4aca6e |
{
|
|
|
4aca6e |
- if (genl_init_handle(&genl_rth, MACSEC_GENL_NAME, &genl_family))
|
|
|
4aca6e |
- exit(1);
|
|
|
4aca6e |
-
|
|
|
4aca6e |
if (argc < 1)
|
|
|
4aca6e |
ipmacsec_usage();
|
|
|
4aca6e |
|
|
|
4aca6e |
if (matches(*argv, "help") == 0)
|
|
|
4aca6e |
ipmacsec_usage();
|
|
|
4aca6e |
|
|
|
4aca6e |
+ if (genl_init_handle(&genl_rth, MACSEC_GENL_NAME, &genl_family))
|
|
|
4aca6e |
+ exit(1);
|
|
|
4aca6e |
+
|
|
|
4aca6e |
if (matches(*argv, "show") == 0)
|
|
|
4aca6e |
return do_show(argc-1, argv+1);
|
|
|
4aca6e |
|
|
|
4aca6e |
--
|
|
|
4aca6e |
1.8.3.1
|
|
|
4aca6e |
|