aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/netlink_compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/netlink_compat.c')
-rw-r--r--net/tipc/netlink_compat.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 899bd94da467..bff9403899ed 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -553,6 +553,22 @@ static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg,
553 return 0; 553 return 0;
554} 554}
555 555
556static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg,
557 struct nlattr **attrs)
558{
559 struct nlattr *link[TIPC_NLA_LINK_MAX + 1];
560 struct tipc_link_info link_info;
561
562 nla_parse_nested(link, TIPC_NLA_LINK_MAX, attrs[TIPC_NLA_LINK], NULL);
563
564 link_info.dest = nla_get_flag(link[TIPC_NLA_LINK_DEST]);
565 link_info.up = htonl(nla_get_flag(link[TIPC_NLA_LINK_UP]));
566 strcpy(link_info.str, nla_data(link[TIPC_NLA_LINK_NAME]));
567
568 return tipc_add_tlv(msg->rep, TIPC_TLV_LINK_INFO,
569 &link_info, sizeof(link_info));
570}
571
556static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg) 572static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg)
557{ 573{
558 struct tipc_nl_compat_cmd_dump dump; 574 struct tipc_nl_compat_cmd_dump dump;
@@ -584,6 +600,12 @@ static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg)
584 dump.dumpit = tipc_nl_link_dump; 600 dump.dumpit = tipc_nl_link_dump;
585 dump.format = tipc_nl_compat_link_stat_dump; 601 dump.format = tipc_nl_compat_link_stat_dump;
586 return tipc_nl_compat_dumpit(&dump, msg); 602 return tipc_nl_compat_dumpit(&dump, msg);
603 case TIPC_CMD_GET_LINKS:
604 msg->req_type = TIPC_TLV_NET_ADDR;
605 msg->rep_size = ULTRA_STRING_MAX_LEN;
606 dump.dumpit = tipc_nl_link_dump;
607 dump.format = tipc_nl_compat_link_dump;
608 return tipc_nl_compat_dumpit(&dump, msg);
587 } 609 }
588 610
589 return -EOPNOTSUPP; 611 return -EOPNOTSUPP;
@@ -684,6 +706,7 @@ static int tipc_nl_compat_tmp_wrap(struct sk_buff *skb, struct genl_info *info)
684 case TIPC_CMD_ENABLE_BEARER: 706 case TIPC_CMD_ENABLE_BEARER:
685 case TIPC_CMD_DISABLE_BEARER: 707 case TIPC_CMD_DISABLE_BEARER:
686 case TIPC_CMD_SHOW_LINK_STATS: 708 case TIPC_CMD_SHOW_LINK_STATS:
709 case TIPC_CMD_GET_LINKS:
687 return tipc_nl_compat_recv(skb, info); 710 return tipc_nl_compat_recv(skb, info);
688 } 711 }
689 712