summaryrefslogtreecommitdiffstats
path: root/lib/route/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/route/link.c')
-rw-r--r--lib/route/link.c11
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)
{