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/ipgre.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/ipgre.c')
-rw-r--r-- | lib/route/link/ipgre.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/route/link/ipgre.c b/lib/route/link/ipgre.c index c39a5e7..7889d11 100644 --- a/lib/route/link/ipgre.c +++ b/lib/route/link/ipgre.c @@ -226,10 +226,16 @@ static void ipgre_dump_details(struct rtnl_link *link, struct nl_dump_params *p) { struct ipgre_info *ipgre = link->l_info; char *name, addr[INET_ADDRSTRLEN]; + struct rtnl_link *parent; if (ipgre->ipgre_mask & IPGRE_ATTR_LINK) { nl_dump(p, " link "); - name = rtnl_link_get_name(link); + + name = NULL; + parent = link_lookup(link->ce_cache, ipgre->link); + if (parent) + name = rtnl_link_get_name(parent); + if (name) nl_dump_line(p, "%s\n", name); else |