diff options
author | Davide Caratti <dcaratti@redhat.com> | 2016-08-30 13:23:12 +0200 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2016-09-01 09:08:50 -0700 |
commit | 5898bd667a483c12ba0ca53aa0ef39f9b98d2fc9 (patch) | |
tree | 452ac1cbe431c80759acef2e71db7d7af7ffefec /ip/ipmacsec.c | |
parent | cc28aad1e6d4f1a5b9e2ba79342bd7fb769a8df3 (diff) | |
download | platform_external_iproute2-5898bd667a483c12ba0ca53aa0ef39f9b98d2fc9.tar.gz platform_external_iproute2-5898bd667a483c12ba0ca53aa0ef39f9b98d2fc9.tar.bz2 platform_external_iproute2-5898bd667a483c12ba0ca53aa0ef39f9b98d2fc9.zip |
macsec: fix input of 'port', improve documentation of 'address'
remove hardcoded base 10 parsing of 'port' parameter, update man page
and fix usage() functions as well. Fix misleading line in man page that
theoretically allowed specifying 'port' keyword right after 'sci' keyword.
Provide documentation of 'address' parameter in man pages and in usage()
functions as well.
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Diffstat (limited to 'ip/ipmacsec.c')
-rw-r--r-- | ip/ipmacsec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c index 6bd1f54f..c75e9d3c 100644 --- a/ip/ipmacsec.c +++ b/ip/ipmacsec.c @@ -95,7 +95,7 @@ static void ipmacsec_usage(void) fprintf(stderr, "where OPTS := [ pn <u32> ] [ on | off ]\n"); fprintf(stderr, " ID := 128-bit hex string\n"); fprintf(stderr, " KEY := 128-bit hex string\n"); - fprintf(stderr, " SCI := { sci <u64> | port <u16> address <lladdr> }\n"); + fprintf(stderr, " SCI := { sci <u64> | port { 1..2^16-1 } address <lladdr> }\n"); exit(-1); } @@ -139,7 +139,7 @@ static int get_sci(__u64 *sci, const char *arg) static int get_port(__be16 *port, const char *arg) { - return get_be16(port, arg, 10); + return get_be16(port, arg, 0); } #define _STR(a) #a @@ -1069,7 +1069,7 @@ static bool check_txsc_flags(bool es, bool scb, bool sci) static void usage(FILE *f) { fprintf(f, - "Usage: ... macsec [ port PORT | sci SCI ]\n" + "Usage: ... macsec [ [ address <lladdr> ] port { 1..2^16-1 } | sci <u64> ]\n" " [ cipher { default | gcm-aes-128 } ]\n" " [ icvlen { 8..16 } ]\n" " [ encrypt { on | off } ]\n" |