Commit 4b942cb1 authored by Stephen Hemminger's avatar Stephen Hemminger

Merge branch 'master' into net-next

parents e4a852f8 e543a6a8
...@@ -94,7 +94,7 @@ void iplink_usage(void) ...@@ -94,7 +94,7 @@ void iplink_usage(void)
fprintf(stderr, "TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | macvtap |\n"); fprintf(stderr, "TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | macvtap |\n");
fprintf(stderr, " bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan |\n"); fprintf(stderr, " bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan |\n");
fprintf(stderr, " gre | gretap | ip6gre | ip6gretap | vti | nlmon |\n"); fprintf(stderr, " gre | gretap | ip6gre | ip6gretap | vti | nlmon |\n");
fprintf(stderr, " bond_slave | ipvlan | geneve }\n"); fprintf(stderr, " bond_slave | ipvlan | geneve | bridge_slave }\n");
} }
exit(-1); exit(-1);
} }
...@@ -508,7 +508,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, ...@@ -508,7 +508,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
} else if (strcmp(*argv, "off") == 0) { } else if (strcmp(*argv, "off") == 0) {
req->i.ifi_flags |= IFF_NOARP; req->i.ifi_flags |= IFF_NOARP;
} else } else
return on_off("noarp", *argv); return on_off("arp", *argv);
} else if (strcmp(*argv, "vf") == 0) { } else if (strcmp(*argv, "vf") == 0) {
struct rtattr *vflist; struct rtattr *vflist;
NEXT_ARG(); NEXT_ARG();
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#include "utils.h" #include "utils.h"
#include "ip_common.h" #include "ip_common.h"
static void explain(void) static void print_explain(FILE *f)
{ {
fprintf(stderr, fprintf(f,
"Usage: ... bridge [ forward_delay FORWARD_DELAY ]\n" "Usage: ... bridge [ forward_delay FORWARD_DELAY ]\n"
" [ hello_time HELLO_TIME ]\n" " [ hello_time HELLO_TIME ]\n"
" [ max_age MAX_AGE ]\n" " [ max_age MAX_AGE ]\n"
...@@ -29,6 +29,11 @@ static void explain(void) ...@@ -29,6 +29,11 @@ static void explain(void)
); );
} }
static void explain(void)
{
print_explain(stderr);
}
static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n) struct nlmsghdr *n)
{ {
...@@ -111,9 +116,16 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) ...@@ -111,9 +116,16 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
rta_getattr_u32(tb[IFLA_BR_MAX_AGE])); rta_getattr_u32(tb[IFLA_BR_MAX_AGE]));
} }
static void bridge_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
print_explain(f);
}
struct link_util bridge_link_util = { struct link_util bridge_link_util = {
.id = "bridge", .id = "bridge",
.maxattr = IFLA_BR_MAX, .maxattr = IFLA_BR_MAX,
.parse_opt = bridge_parse_opt, .parse_opt = bridge_parse_opt,
.print_opt = bridge_print_opt, .print_opt = bridge_print_opt,
.print_help = bridge_print_help,
}; };
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
#include "utils.h" #include "utils.h"
#include "ip_common.h" #include "ip_common.h"
static void explain(void) static void print_explain(FILE *f)
{ {
fprintf(stderr, fprintf(f,
"Usage: ... bridge_slave [ state STATE ] [ priority PRIO ] [cost COST ]\n" "Usage: ... bridge_slave [ state STATE ] [ priority PRIO ] [cost COST ]\n"
" [ guard {on | off} ]\n" " [ guard {on | off} ]\n"
" [ hairpin {on | off} ] \n" " [ hairpin {on | off} ] \n"
...@@ -32,6 +32,11 @@ static void explain(void) ...@@ -32,6 +32,11 @@ static void explain(void)
); );
} }
static void explain(void)
{
print_explain(stderr);
}
static const char *port_states[] = { static const char *port_states[] = {
[BR_STATE_DISABLED] = "disabled", [BR_STATE_DISABLED] = "disabled",
[BR_STATE_LISTENING] = "listening", [BR_STATE_LISTENING] = "listening",
...@@ -172,10 +177,17 @@ static int bridge_slave_parse_opt(struct link_util *lu, int argc, char **argv, ...@@ -172,10 +177,17 @@ static int bridge_slave_parse_opt(struct link_util *lu, int argc, char **argv,
return 0; return 0;
} }
static void bridge_slave_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
print_explain(f);
}
struct link_util bridge_slave_link_util = { struct link_util bridge_slave_link_util = {
.id = "bridge", .id = "bridge",
.maxattr = IFLA_BRPORT_MAX, .maxattr = IFLA_BRPORT_MAX,
.print_opt = bridge_slave_print_opt, .print_opt = bridge_slave_print_opt,
.parse_opt = bridge_slave_parse_opt, .parse_opt = bridge_slave_parse_opt,
.print_help = bridge_slave_print_help,
.slave = true, .slave = true,
}; };
...@@ -139,7 +139,7 @@ struct nsid_cache { ...@@ -139,7 +139,7 @@ struct nsid_cache {
struct hlist_node nsid_hash; struct hlist_node nsid_hash;
struct hlist_node name_hash; struct hlist_node name_hash;
int nsid; int nsid;
char name[NAME_MAX]; char name[0];
}; };
#define NSIDMAP_SIZE 128 #define NSIDMAP_SIZE 128
...@@ -164,7 +164,7 @@ static struct nsid_cache *netns_map_get_by_nsid(int nsid) ...@@ -164,7 +164,7 @@ static struct nsid_cache *netns_map_get_by_nsid(int nsid)
return NULL; return NULL;
} }
static int netns_map_add(int nsid, char *name) static int netns_map_add(int nsid, const char *name)
{ {
struct nsid_cache *c; struct nsid_cache *c;
uint32_t h; uint32_t h;
...@@ -172,7 +172,7 @@ static int netns_map_add(int nsid, char *name) ...@@ -172,7 +172,7 @@ static int netns_map_add(int nsid, char *name)
if (netns_map_get_by_nsid(nsid) != NULL) if (netns_map_get_by_nsid(nsid) != NULL)
return -EEXIST; return -EEXIST;
c = malloc(sizeof(*c)); c = malloc(sizeof(*c) + strlen(name));
if (c == NULL) { if (c == NULL) {
perror("malloc"); perror("malloc");
return -ENOMEM; return -ENOMEM;
......
...@@ -889,7 +889,7 @@ output more statistics about packet usage. ...@@ -889,7 +889,7 @@ output more statistics about packet usage.
output more detailed information. output more detailed information.
.TP .TP
.BR "\-h", " \-human", " \-human-readble" .BR "\-h", " \-human", " \-human-readable"
output statistics with human readable values number followed by suffix output statistics with human readable values number followed by suffix
.TP .TP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment