[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201117091938.GA562664@tws>
Date: Tue, 17 Nov 2020 10:19:38 +0100
From: Oliver Herms <oliver.peter.herms@...il.com>
To: netdev@...r.kernel.org
Cc: dsahern@...il.com, davem@...emloft.net, kuznet@....inr.ac.ru,
yoshfuji@...ux-ipv6.org, kuba@...nel.org
Subject: [PATCH v2] IPv6: RTM_GETROUTE: Add RTA_ENCAP to result
This patch adds an IPv6 routes encapsulation attribute
to the result of netlink RTM_GETROUTE requests
(i.e. ip route get 2001:db8::).
Signed-off-by: Oliver Herms <oliver.peter.herms@...il.com>
---
net/ipv6/route.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 82cbb46a2a4f..d7e94eac3136 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -5489,6 +5489,10 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
rtm->rtm_scope = RT_SCOPE_UNIVERSE;
rtm->rtm_protocol = rt->fib6_protocol;
+ if (dst && dst->lwtstate && lwtunnel_fill_encap(skb, dst->lwtstate,
+ RTA_ENCAP, RTA_ENCAP_TYPE) < 0)
+ goto nla_put_failure;
+
if (rt6_flags & RTF_CACHE)
rtm->rtm_flags |= RTM_F_CLONED;
--
2.25.1
Powered by blists - more mailing lists