diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2015-10-16 09:21:25 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-11-19 16:40:17 (GMT) |
commit | 3fedee55b8965a7496762fcef2f73455644f67f5 (patch) | |
tree | a94e6f527cdc3a76ebab043b2ef9e61d236e377e /lib/route/link.c | |
parent | 3f231213c7c586b5a5e8ce6b1ea9c1d3b24d74c0 (diff) | |
download | libnl-3fedee55b8965a7496762fcef2f73455644f67f5.zip libnl-3fedee55b8965a7496762fcef2f73455644f67f5.tar.gz libnl-3fedee55b8965a7496762fcef2f73455644f67f5.tar.bz2 |
route/link: fix dump of parent link for some link types
Some link types incorrectly dump their own interface name as parent
link; fix this.
Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/route/link.c')
-rw-r--r-- | lib/route/link.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/route/link.c b/lib/route/link.c index 6dc416b..8ef43b5 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -67,6 +67,17 @@ static struct nl_cache_ops rtnl_link_ops; static struct nl_object_ops link_obj_ops; /** @endcond */ +struct rtnl_link *link_lookup(struct nl_cache *cache, int ifindex) +{ + if (!cache) { + cache = __nl_cache_mngt_require("route/link"); + if (!cache) + return NULL; + } + + return rtnl_link_get(cache, ifindex); +} + static struct rtnl_link_af_ops *af_lookup_and_alloc(struct rtnl_link *link, int family) { |