|
|
4aca6e |
From 9c3efe55ac335b744aa993351f20ea9488aeaae5 Mon Sep 17 00:00:00 2001
|
|
|
4aca6e |
From: Davide Caratti <dcaratti@redhat.com>
|
|
|
4aca6e |
Date: Fri, 25 Nov 2016 10:43:09 +0100
|
|
|
4aca6e |
Subject: [PATCH] macsec: fix input of 'port', improve documentation of
|
|
|
4aca6e |
'address'
|
|
|
4aca6e |
|
|
|
4aca6e |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1355629
|
|
|
4aca6e |
Upstream Status: iproute2.git commit 5898bd667a48
|
|
|
4aca6e |
|
|
|
4aca6e |
commit 5898bd667a483c12ba0ca53aa0ef39f9b98d2fc9
|
|
|
4aca6e |
Author: Davide Caratti <dcaratti@redhat.com>
|
|
|
4aca6e |
Date: Tue Aug 30 13:23:12 2016 +0200
|
|
|
4aca6e |
|
|
|
4aca6e |
macsec: fix input of 'port', improve documentation of 'address'
|
|
|
4aca6e |
|
|
|
4aca6e |
remove hardcoded base 10 parsing of 'port' parameter, update man page
|
|
|
4aca6e |
and fix usage() functions as well. Fix misleading line in man page that
|
|
|
4aca6e |
theoretically allowed specifying 'port' keyword right after 'sci' keyword.
|
|
|
4aca6e |
Provide documentation of 'address' parameter in man pages and in usage()
|
|
|
4aca6e |
functions as well.
|
|
|
4aca6e |
|
|
|
4aca6e |
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
|
|
|
4aca6e |
|
|
|
4aca6e |
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
|
|
|
4aca6e |
---
|
|
|
4aca6e |
ip/ipmacsec.c | 6 +++---
|
|
|
4aca6e |
man/man8/ip-link.8.in | 14 +++++++++++---
|
|
|
4aca6e |
man/man8/ip-macsec.8 | 12 +++++++++---
|
|
|
4aca6e |
3 files changed, 23 insertions(+), 9 deletions(-)
|
|
|
4aca6e |
|
|
|
4aca6e |
diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c
|
|
|
4aca6e |
index 329be00..21e53be 100644
|
|
|
4aca6e |
--- a/ip/ipmacsec.c
|
|
|
4aca6e |
+++ b/ip/ipmacsec.c
|
|
|
4aca6e |
@@ -110,7 +110,7 @@ static void ipmacsec_usage(void)
|
|
|
4aca6e |
fprintf(stderr, "where OPTS := [ pn <u32> ] [ on | off ]\n");
|
|
|
4aca6e |
fprintf(stderr, " ID := 128-bit hex string\n");
|
|
|
4aca6e |
fprintf(stderr, " KEY := 128-bit hex string\n");
|
|
|
4aca6e |
- fprintf(stderr, " SCI := { sci <u64> | port <u16> address <lladdr> }\n");
|
|
|
4aca6e |
+ fprintf(stderr, " SCI := { sci <u64> | port { 1..2^16-1 } address <lladdr> }\n");
|
|
|
4aca6e |
|
|
|
4aca6e |
exit(-1);
|
|
|
4aca6e |
}
|
|
|
4aca6e |
@@ -154,7 +154,7 @@ static int get_sci(__u64 *sci, const char *arg)
|
|
|
4aca6e |
|
|
|
4aca6e |
static int get_port(__be16 *port, const char *arg)
|
|
|
4aca6e |
{
|
|
|
4aca6e |
- return get_be16(port, arg, 10);
|
|
|
4aca6e |
+ return get_be16(port, arg, 0);
|
|
|
4aca6e |
}
|
|
|
4aca6e |
|
|
|
4aca6e |
#define _STR(a) #a
|
|
|
4aca6e |
@@ -1083,7 +1083,7 @@ static bool check_txsc_flags(bool es, bool scb, bool sci)
|
|
|
4aca6e |
static void usage(FILE *f)
|
|
|
4aca6e |
{
|
|
|
4aca6e |
fprintf(f,
|
|
|
4aca6e |
- "Usage: ... macsec [ port PORT | sci SCI ]\n"
|
|
|
4aca6e |
+ "Usage: ... macsec [ [ address <lladdr> ] port { 1..2^16-1 } | sci <u64> ]\n"
|
|
|
4aca6e |
" [ cipher { default | gcm-aes-128 } ]\n"
|
|
|
4aca6e |
" [ icvlen { 8..16 } ]\n"
|
|
|
4aca6e |
" [ encrypt { on | off } ]\n"
|
|
|
4aca6e |
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
|
|
|
4aca6e |
index 8968cf2..fd665b8 100644
|
|
|
4aca6e |
--- a/man/man8/ip-link.8.in
|
|
|
4aca6e |
+++ b/man/man8/ip-link.8.in
|
|
|
4aca6e |
@@ -782,7 +782,9 @@ For a link of type
|
|
|
4aca6e |
the following additional arguments are supported:
|
|
|
4aca6e |
|
|
|
4aca6e |
.BI "ip link add link " DEVICE " name " NAME " type macsec"
|
|
|
4aca6e |
-[
|
|
|
4aca6e |
+[ [
|
|
|
4aca6e |
+.BI address " <lladdr>"
|
|
|
4aca6e |
+]
|
|
|
4aca6e |
.BI port " PORT"
|
|
|
4aca6e |
|
|
|
|
4aca6e |
.BI sci " SCI"
|
|
|
4aca6e |
@@ -806,8 +808,14 @@ the following additional arguments are supported:
|
|
|
4aca6e |
|
|
|
4aca6e |
.in +8
|
|
|
4aca6e |
.sp
|
|
|
4aca6e |
-.BI port " PORT "
|
|
|
4aca6e |
-- sets the port number for this MACsec device.
|
|
|
4aca6e |
+.BI address " <lladdr> "
|
|
|
4aca6e |
+- sets the system identifier component of secure channel for this MACsec device.
|
|
|
4aca6e |
+
|
|
|
4aca6e |
+.sp
|
|
|
4aca6e |
+.BI port " PORT "
|
|
|
4aca6e |
+- sets the port number component of secure channel for this MACsec device, in a
|
|
|
4aca6e |
+range from 1 to 65535 inclusive. Numbers with a leading " 0 " or " 0x " are
|
|
|
4aca6e |
+interpreted as octal and hexadecimal, respectively.
|
|
|
4aca6e |
|
|
|
4aca6e |
.sp
|
|
|
4aca6e |
.BI sci " SCI "
|
|
|
4aca6e |
diff --git a/man/man8/ip-macsec.8 b/man/man8/ip-macsec.8
|
|
|
4aca6e |
index 105aeec..1aca3bd 100644
|
|
|
4aca6e |
--- a/man/man8/ip-macsec.8
|
|
|
4aca6e |
+++ b/man/man8/ip-macsec.8
|
|
|
4aca6e |
@@ -3,10 +3,12 @@
|
|
|
4aca6e |
ip-macsec \- MACsec device configuration
|
|
|
4aca6e |
.SH "SYNOPSIS"
|
|
|
4aca6e |
.BI "ip link add link " DEVICE " name " NAME " type macsec "
|
|
|
4aca6e |
-[
|
|
|
4aca6e |
+[ [
|
|
|
4aca6e |
+.BI address " <lladdr>"
|
|
|
4aca6e |
+]
|
|
|
4aca6e |
.BI port " PORT"
|
|
|
4aca6e |
|
|
|
|
4aca6e |
-.BI sci " SCI"
|
|
|
4aca6e |
+.BI sci " <u64>"
|
|
|
4aca6e |
] [
|
|
|
4aca6e |
.BR cipher " { " default " | " gcm-aes-128 " } ] ["
|
|
|
4aca6e |
.BI icvlen " ICVLEN"
|
|
|
4aca6e |
@@ -62,8 +64,12 @@ ip-macsec \- MACsec device configuration
|
|
|
4aca6e |
.IR SCI " := { "
|
|
|
4aca6e |
.B sci
|
|
|
4aca6e |
.IR <u64> " | "
|
|
|
4aca6e |
-.BI port " <u16> " address " <lladdr> "
|
|
|
4aca6e |
+.BI port
|
|
|
4aca6e |
+.IR PORT
|
|
|
4aca6e |
+.BI address " <lladdr> "
|
|
|
4aca6e |
}
|
|
|
4aca6e |
+.br
|
|
|
4aca6e |
+.IR PORT " := { " 1..2^16-1 " } "
|
|
|
4aca6e |
|
|
|
4aca6e |
|
|
|
4aca6e |
.SH DESCRIPTION
|
|
|
4aca6e |
--
|
|
|
4aca6e |
1.8.3.1
|
|
|
4aca6e |
|