diff options
author | Thomas Graf <tgraf@suug.ch> | 2011-04-19 07:57:35 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2011-04-19 07:57:35 (GMT) |
commit | 36b04747c72b02a1cd084e77783a9e81c145463b (patch) | |
tree | 4e8ffee0f7f3511495948de81b13f9e5c1fb1f84 /lib | |
parent | 3d70697e4cb35f51f776791590bd6f81a46cc66e (diff) | |
download | libnl-36b04747c72b02a1cd084e77783a9e81c145463b.zip libnl-36b04747c72b02a1cd084e77783a9e81c145463b.tar.gz libnl-36b04747c72b02a1cd084e77783a9e81c145463b.tar.bz2 |
Support link info types with no payload
Diffstat (limited to 'lib')
-rw-r--r-- | lib/route/link.c | 9 |
1 files 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) |