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.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 48e15a4a36d8..d23075efaa76 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -822,6 +822,19 @@ static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg,
822 return 0; 822 return 0;
823} 823}
824 824
825static int tipc_nl_compat_media_dump(struct tipc_nl_compat_msg *msg,
826 struct nlattr **attrs)
827{
828 struct nlattr *media[TIPC_NLA_MEDIA_MAX + 1];
829
830 nla_parse_nested(media, TIPC_NLA_MEDIA_MAX, attrs[TIPC_NLA_MEDIA],
831 NULL);
832
833 return tipc_add_tlv(msg->rep, TIPC_TLV_MEDIA_NAME,
834 nla_data(media[TIPC_NLA_MEDIA_NAME]),
835 nla_len(media[TIPC_NLA_MEDIA_NAME]));
836}
837
825static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg) 838static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg)
826{ 839{
827 struct tipc_nl_compat_cmd_dump dump; 840 struct tipc_nl_compat_cmd_dump dump;
@@ -885,6 +898,11 @@ static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg)
885 dump.dumpit = tipc_nl_sk_dump; 898 dump.dumpit = tipc_nl_sk_dump;
886 dump.format = tipc_nl_compat_sk_dump; 899 dump.format = tipc_nl_compat_sk_dump;
887 return tipc_nl_compat_dumpit(&dump, msg); 900 return tipc_nl_compat_dumpit(&dump, msg);
901 case TIPC_CMD_GET_MEDIA_NAMES:
902 msg->rep_size = MAX_MEDIA * TLV_SPACE(TIPC_MAX_MEDIA_NAME);
903 dump.dumpit = tipc_nl_media_dump;
904 dump.format = tipc_nl_compat_media_dump;
905 return tipc_nl_compat_dumpit(&dump, msg);
888 } 906 }
889 907
890 return -EOPNOTSUPP; 908 return -EOPNOTSUPP;
@@ -992,6 +1010,7 @@ static int tipc_nl_compat_tmp_wrap(struct sk_buff *skb, struct genl_info *info)
992 case TIPC_CMD_RESET_LINK_STATS: 1010 case TIPC_CMD_RESET_LINK_STATS:
993 case TIPC_CMD_SHOW_NAME_TABLE: 1011 case TIPC_CMD_SHOW_NAME_TABLE:
994 case TIPC_CMD_SHOW_PORTS: 1012 case TIPC_CMD_SHOW_PORTS:
1013 case TIPC_CMD_GET_MEDIA_NAMES:
995 return tipc_nl_compat_recv(skb, info); 1014 return tipc_nl_compat_recv(skb, info);
996 } 1015 }
997 1016