Merge branch 'main' into next

Conflicts:
	ip/ipneigh.c

Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
David Ahern 2021-10-09 17:47:47 -06:00
commit 8cd517a805
13 changed files with 52 additions and 49 deletions

View File

@ -37,10 +37,10 @@ static void usage(void)
fprintf(stderr,
"Usage: bridge [ OPTIONS ] OBJECT { COMMAND | help }\n"
" bridge [ -force ] -batch filename\n"
"where OBJECT := { link | fdb | mdb | vlan | monitor }\n"
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] |\n"
" -o[neline] | -t[imestamp] | -n[etns] name |\n"
" -c[ompressvlans] -color -p[retty] -j[son] }\n");
"where OBJECT := { link | fdb | mdb | vlan | monitor }\n"
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] |\n"
" -o[neline] | -t[imestamp] | -n[etns] name |\n"
" -c[ompressvlans] -color -p[retty] -j[son] }\n");
exit(-1);
}

View File

@ -278,7 +278,7 @@ static int mptcp_addr_dump(void)
return -2;
}
close_json_object();
delete_json_obj();
fflush(stdout);
return 0;
}

View File

@ -37,8 +37,8 @@ static void usage(void)
{
fprintf(stderr,
"Usage: ip mroute show [ [ to ] PREFIX ] [ from PREFIX ] [ iif DEVICE ]\n"
" [ table TABLE_ID ]\n"
"TABLE_ID := [ local | main | default | all | NUMBER ]\n"
" [ table TABLE_ID ]\n"
"TABLE_ID := [ local | main | default | all | NUMBER ]\n"
#if 0
"Usage: ip mroute [ add | del ] DESTINATION from SOURCE [ iif DEVICE ] [ oif DEVICE ]\n"
#endif

View File

@ -50,8 +50,8 @@ static void usage(void)
{
fprintf(stderr,
"Usage: ip neigh { add | del | change | replace }\n"
" { ADDR [ lladdr LLADDR ] [ nud STATE ] proxy ADDR }\n"
" [ dev DEV ] [ router ] [ extern_learn ] [ protocol PROTO ]\n"
" { ADDR [ lladdr LLADDR ] [ nud STATE ] proxy ADDR }\n"
" [ dev DEV ] [ router ] [ extern_learn ] [ protocol PROTO ]\n"
"\n"
" ip neigh { show | flush } [ proxy ] [ to PREFIX ] [ dev DEV ] [ nud STATE ]\n"
" [ vrf NAME ] [ nomaster ]\n"

View File

@ -47,15 +47,15 @@ static void usage(void)
{
fprintf(stderr,
"Usage: ip ntable change name NAME [ dev DEV ]\n"
" [ thresh1 VAL ] [ thresh2 VAL ] [ thresh3 VAL ] [ gc_int MSEC ]\n"
" [ PARMS ]\n"
" [ thresh1 VAL ] [ thresh2 VAL ] [ thresh3 VAL ] [ gc_int MSEC ]\n"
" [ PARMS ]\n"
"Usage: ip ntable show [ dev DEV ] [ name NAME ]\n"
"PARMS := [ base_reachable MSEC ] [ retrans MSEC ] [ gc_stale MSEC ]\n"
" [ delay_probe MSEC ] [ queue LEN ]\n"
" [ app_probes VAL ] [ ucast_probes VAL ] [ mcast_probes VAL ]\n"
" [ anycast_delay MSEC ] [ proxy_delay MSEC ] [ proxy_queue LEN ]\n"
" [ locktime MSEC ]\n"
" [ delay_probe MSEC ] [ queue LEN ]\n"
" [ app_probes VAL ] [ ucast_probes VAL ] [ mcast_probes VAL ]\n"
" [ anycast_delay MSEC ] [ proxy_delay MSEC ] [ proxy_queue LEN ]\n"
" [ locktime MSEC ]\n"
);
exit(-1);

View File

@ -83,7 +83,7 @@ static void usage(void)
" [ ttl-propagate { enabled | disabled } ]\n"
"INFO_SPEC := { NH | nhid ID } OPTIONS FLAGS [ nexthop NH ]...\n"
"NH := [ encap ENCAPTYPE ENCAPHDR ] [ via [ FAMILY ] ADDRESS ]\n"
" [ dev STRING ] [ weight NUMBER ] NHFLAGS\n"
" [ dev STRING ] [ weight NUMBER ] NHFLAGS\n"
"FAMILY := [ inet | inet6 | mpls | bridge | link ]\n"
"OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ] [ as [ to ] ADDRESS ]\n"
" [ rtt TIME ] [ rttvar TIME ] [ reordering NUMBER ]\n"

View File

@ -34,10 +34,10 @@ static void usage(void)
{
fprintf(stderr,
"Usage: ip sr { COMMAND | help }\n"
" ip sr hmac show\n"
" ip sr hmac set KEYID ALGO\n"
" ip sr tunsrc show\n"
" ip sr tunsrc set ADDRESS\n"
" ip sr hmac show\n"
" ip sr hmac set KEYID ALGO\n"
" ip sr tunsrc show\n"
" ip sr tunsrc set ADDRESS\n"
"where ALGO := { sha1 | sha256 }\n");
exit(-1);
}

View File

@ -34,18 +34,18 @@ static void usage(void)
{
fprintf(stderr,
"Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ]\n"
" [ mode { gre | ipip | isatap | sit | vti } ]\n"
" [ remote ADDR ] [ local ADDR ]\n"
" [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n"
" [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]\n"
" [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n"
" [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n"
" [ mode { gre | ipip | isatap | sit | vti } ]\n"
" [ remote ADDR ] [ local ADDR ]\n"
" [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n"
" [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]\n"
" [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n"
" [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n"
"\n"
"Where: NAME := STRING\n"
" ADDR := { IP_ADDRESS | any }\n"
" TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff }\n"
" TTL := { 1..255 | inherit }\n"
" KEY := { DOTTED_QUAD | NUMBER }\n");
"Where: NAME := STRING\n"
" ADDR := { IP_ADDRESS | any }\n"
" TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff }\n"
" TTL := { 1..255 | inherit }\n"
" KEY := { DOTTED_QUAD | NUMBER }\n");
exit(-1);
}

View File

@ -42,11 +42,11 @@ static void usage(void)
{
fprintf(stderr,
"Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ]\n"
" [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n"
" [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ]\n"
" [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n"
" [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ]\n"
"\n"
"Where: USER := { STRING | NUMBER }\n"
" GROUP := { STRING | NUMBER }\n");
"Where: USER := { STRING | NUMBER }\n"
" GROUP := { STRING | NUMBER }\n");
exit(-1);
}

View File

@ -65,7 +65,7 @@ static void usage(void)
fprintf(stderr,
"Usage: rtmon [ OPTIONS ] file FILE [ all | LISTofOBJECTS ]\n"
"OPTIONS := { -f[amily] { inet | inet6 | link | help } |\n"
" -4 | -6 | -0 | -V[ersion] }\n"
" -4 | -6 | -0 | -V[ersion] }\n"
"LISTofOBJECTS := [ link ] [ address ] [ route ]\n");
exit(-1);
}

View File

@ -533,9 +533,12 @@ static int bpf_mnt_check_target(const char *target)
int ret;
ret = mkdir(target, S_IRWXU);
if (ret && errno != EEXIST)
if (ret) {
if (errno == EEXIST)
return 0;
fprintf(stderr, "mkdir %s failed: %s\n", target,
strerror(errno));
}
return ret;
}

View File

@ -547,17 +547,17 @@ static void usage(void)
{
fprintf(stderr,
"Usage: nstat [OPTION] [ PATTERN [ PATTERN ] ]\n"
" -h, --help this message\n"
" -a, --ignore ignore history\n"
" -d, --scan=SECS sample every statistics every SECS\n"
" -j, --json format output in JSON\n"
" -n, --nooutput do history only\n"
" -p, --pretty pretty print\n"
" -r, --reset reset history\n"
" -s, --noupdate don't update history\n"
" -t, --interval=SECS report average over the last SECS\n"
" -V, --version output version information\n"
" -z, --zeros show entries with zero activity\n");
" -h, --help this message\n"
" -a, --ignore ignore history\n"
" -d, --scan=SECS sample every statistics every SECS\n"
" -j, --json format output in JSON\n"
" -n, --nooutput do history only\n"
" -p, --pretty pretty print\n"
" -r, --reset reset history\n"
" -s, --noupdate don't update history\n"
" -t, --interval=SECS report average over the last SECS\n"
" -V, --version output version information\n"
" -z, --zeros show entries with zero activity\n");
exit(-1);
}

View File

@ -725,7 +725,7 @@ static int flower_parse_port(char *str, __u8 ip_proto,
if (min && max) {
__be16 min_port_type, max_port_type;
if (max <= min) {
if (ntohs(max) <= ntohs(min)) {
fprintf(stderr, "max value should be greater than min value\n");
return -1;
}