mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-10-26 13:54:06 +00:00
Merge branch 'master' into iproute2-next
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
commit
0d30c1f8d4
@ -145,7 +145,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
|
|||||||
NEXT_ARG();
|
NEXT_ARG();
|
||||||
check_duparg(&attrs, IFLA_VXLAN_TTL, "ttl", *argv);
|
check_duparg(&attrs, IFLA_VXLAN_TTL, "ttl", *argv);
|
||||||
if (strcmp(*argv, "inherit") == 0) {
|
if (strcmp(*argv, "inherit") == 0) {
|
||||||
addattr_l(n, 1024, IFLA_VXLAN_TTL_INHERIT, NULL, 0);
|
addattr(n, 1024, IFLA_VXLAN_TTL_INHERIT);
|
||||||
} else if (strcmp(*argv, "auto") == 0) {
|
} else if (strcmp(*argv, "auto") == 0) {
|
||||||
addattr8(n, 1024, IFLA_VXLAN_TTL, ttl);
|
addattr8(n, 1024, IFLA_VXLAN_TTL, ttl);
|
||||||
} else {
|
} else {
|
||||||
@ -527,12 +527,16 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
|
|||||||
print_string(PRINT_FP, NULL, "tos %s ", "inherit");
|
print_string(PRINT_FP, NULL, "tos %s ", "inherit");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tb[IFLA_VXLAN_TTL])
|
if (tb[IFLA_VXLAN_TTL_INHERIT] &&
|
||||||
ttl = rta_getattr_u8(tb[IFLA_VXLAN_TTL]);
|
rta_getattr_u8(tb[IFLA_VXLAN_TTL_INHERIT])) {
|
||||||
if (is_json_context() || ttl)
|
|
||||||
print_uint(PRINT_ANY, "ttl", "ttl %u ", ttl);
|
|
||||||
else
|
|
||||||
print_string(PRINT_FP, NULL, "ttl %s ", "inherit");
|
print_string(PRINT_FP, NULL, "ttl %s ", "inherit");
|
||||||
|
} else if (tb[IFLA_VXLAN_TTL]) {
|
||||||
|
ttl = rta_getattr_u8(tb[IFLA_VXLAN_TTL]);
|
||||||
|
if (is_json_context() || ttl)
|
||||||
|
print_uint(PRINT_ANY, "ttl", "ttl %u ", ttl);
|
||||||
|
else
|
||||||
|
print_string(PRINT_FP, NULL, "ttl %s ", "auto");
|
||||||
|
}
|
||||||
|
|
||||||
if (tb[IFLA_VXLAN_LABEL]) {
|
if (tb[IFLA_VXLAN_LABEL]) {
|
||||||
__u32 label = rta_getattr_u32(tb[IFLA_VXLAN_LABEL]);
|
__u32 label = rta_getattr_u32(tb[IFLA_VXLAN_LABEL]);
|
||||||
|
|||||||
@ -802,6 +802,7 @@ static int __rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iov,
|
|||||||
|
|
||||||
if (h->nlmsg_type == NLMSG_ERROR) {
|
if (h->nlmsg_type == NLMSG_ERROR) {
|
||||||
struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(h);
|
struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(h);
|
||||||
|
int error = err->error;
|
||||||
|
|
||||||
if (l < sizeof(struct nlmsgerr)) {
|
if (l < sizeof(struct nlmsgerr)) {
|
||||||
fprintf(stderr, "ERROR truncated\n");
|
fprintf(stderr, "ERROR truncated\n");
|
||||||
@ -809,11 +810,11 @@ static int __rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iov,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!err->error)
|
if (!error) {
|
||||||
/* check messages from kernel */
|
/* check messages from kernel */
|
||||||
nl_dump_ext_ack(h, errfn);
|
nl_dump_ext_ack(h, errfn);
|
||||||
else {
|
} else {
|
||||||
errno = -err->error;
|
errno = -error;
|
||||||
|
|
||||||
if (rtnl->proto != NETLINK_SOCK_DIAG &&
|
if (rtnl->proto != NETLINK_SOCK_DIAG &&
|
||||||
show_rtnl_err)
|
show_rtnl_err)
|
||||||
@ -825,7 +826,7 @@ static int __rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iov,
|
|||||||
else
|
else
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
return err->error ? -i : 0;
|
return error ? -i : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (answer) {
|
if (answer) {
|
||||||
|
|||||||
@ -69,9 +69,12 @@ static int fifo_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
|
|||||||
qopt = RTA_DATA(opt);
|
qopt = RTA_DATA(opt);
|
||||||
if (strcmp(qu->id, "bfifo") == 0) {
|
if (strcmp(qu->id, "bfifo") == 0) {
|
||||||
SPRINT_BUF(b1);
|
SPRINT_BUF(b1);
|
||||||
fprintf(f, "limit %s", sprint_size(qopt->limit, b1));
|
print_uint(PRINT_JSON, "limit", NULL, qopt->limit);
|
||||||
} else
|
print_string(PRINT_FP, NULL, "limit %s",
|
||||||
fprintf(f, "limit %up", qopt->limit);
|
sprint_size(qopt->limit, b1));
|
||||||
|
} else {
|
||||||
|
print_uint(PRINT_ANY, "limit", "limit %up", qopt->limit);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user