Merge branch 'iproute2-master' into iproute2-next

Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
David Ahern 2018-06-05 14:22:15 -07:00
commit 55b973329c
5 changed files with 20 additions and 26 deletions

View File

@ -271,15 +271,9 @@ struct mnlg_socket *mnlg_socket_open(const char *family_name, uint8_t version)
if (!nlg->nl)
goto err_mnl_socket_open;
err = mnl_socket_setsockopt(nlg->nl, NETLINK_CAP_ACK, &one,
sizeof(one));
if (err)
goto err_mnl_set_ack;
err = mnl_socket_setsockopt(nlg->nl, NETLINK_EXT_ACK, &one,
sizeof(one));
if (err)
goto err_mnl_set_ext_ack;
/* Older kernels may no support capped/extended ACK reporting */
mnl_socket_setsockopt(nlg->nl, NETLINK_CAP_ACK, &one, sizeof(one));
mnl_socket_setsockopt(nlg->nl, NETLINK_EXT_ACK, &one, sizeof(one));
err = mnl_socket_bind(nlg->nl, 0, MNL_SOCKET_AUTOPID);
if (err < 0)
@ -305,8 +299,6 @@ struct mnlg_socket *mnlg_socket_open(const char *family_name, uint8_t version)
err_mnlg_socket_recv_run:
err_mnlg_socket_send:
err_mnl_socket_bind:
err_mnl_set_ext_ack:
err_mnl_set_ack:
mnl_socket_close(nlg->nl);
err_mnl_socket_open:
free(nlg->buf);

View File

@ -16,16 +16,3 @@
15 ntk
16 dhcp
42 babel
#
# Used by me for gated
#
254 gated/aggr
253 gated/bgp
252 gated/ospf
251 gated/ospfase
250 gated/rip
249 gated/static
248 gated/conn
247 gated/inet
246 gated/default

View File

@ -964,6 +964,17 @@ int print_linkinfo(const struct sockaddr_nl *who,
}
}
if (tb[IFLA_NEW_NETNSID]) {
int id = rta_getattr_u32(tb[IFLA_NEW_NETNSID]);
print_int(PRINT_FP, NULL, " new-nsid %d", id);
}
if (tb[IFLA_NEW_IFINDEX]) {
int id = rta_getattr_u32(tb[IFLA_NEW_IFINDEX]);
print_int(PRINT_FP, NULL, " new-ifindex %d", id);
}
if (tb[IFLA_PROTO_DOWN]) {
if (rta_getattr_u8(tb[IFLA_PROTO_DOWN]))
print_bool(PRINT_ANY,

View File

@ -191,6 +191,7 @@ int name_is_vrf(const char *name)
struct rtattr *tb[IFLA_MAX+1];
struct rtattr *li[IFLA_INFO_MAX+1];
struct ifinfomsg *ifi;
int ifindex = 0;
int len;
addattr_l(&req.n, sizeof(req), IFLA_IFNAME, name, strlen(name) + 1);
@ -218,7 +219,8 @@ int name_is_vrf(const char *name)
if (strcmp(RTA_DATA(li[IFLA_INFO_KIND]), "vrf"))
goto out;
ifindex = ifi->ifi_index;
out:
free(answer);
return ifi->ifi_index;
return ifindex;
}

View File

@ -359,6 +359,8 @@ int do_xfrm_monitor(int argc, char **argv)
if (matches(*argv, "file") == 0) {
NEXT_ARG();
file = *argv;
} else if (strcmp(*argv, "all") == 0) {
/* fall out */
} else if (matches(*argv, "all-nsid") == 0) {
listen_all_nsid = 1;
} else if (matches(*argv, "acquire") == 0) {
@ -381,7 +383,7 @@ int do_xfrm_monitor(int argc, char **argv)
groups = 0;
} else if (matches(*argv, "help") == 0) {
usage();
} else if (strcmp(*argv, "all")) {
} else {
fprintf(stderr, "Argument \"%s\" is unknown, try \"ip xfrm monitor help\".\n", *argv);
exit(-1);
}