From 36b04747c72b02a1cd084e77783a9e81c145463b Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Tue, 19 Apr 2011 09:57:35 +0200 Subject: Support link info types with no payload --- lib/route/link.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/route/link.c b/lib/route/link.c index 9dfa5e1..cb92f19 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -593,15 +593,16 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who, if (err < 0) goto errout; - if (li[IFLA_INFO_KIND] && - (li[IFLA_INFO_DATA] || li[IFLA_INFO_XSTATS])) { + if (li[IFLA_INFO_KIND]) { struct rtnl_link_info_ops *ops; char *kind; kind = nla_get_string(li[IFLA_INFO_KIND]); ops = rtnl_link_info_ops_lookup(kind); - if (ops && ops->io_parse) { - link->l_info_ops = ops; + link->l_info_ops = ops; + + if (ops && ops->io_parse && + (li[IFLA_INFO_DATA] || li[IFLA_INFO_XSTATS])) { err = ops->io_parse(link, li[IFLA_INFO_DATA], li[IFLA_INFO_XSTATS]); if (err < 0) -- cgit v1.2.1