diff options
author | Oliver Herms <oliver.peter.herms@gmail.com> | 2020-11-19 02:06:51 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-20 08:56:20 +0300 |
commit | 6b13d8f71fb37c573993eccdf190e566d136c117 (patch) | |
tree | 90838117320c1de670c7e3caab357013db68c74c /net/ipv6/route.c | |
parent | b680a214ec281dbd44b5ebbf3f126a57f1ecf0f7 (diff) | |
download | linux-6b13d8f71fb37c573993eccdf190e566d136c117.tar.xz |
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@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20201118230651.GA8861@tws
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index f91a689edafd..188e114b29b4 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -5558,6 +5558,10 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb, if (dst->dev && nla_put_u32(skb, RTA_OIF, dst->dev->ifindex)) goto nla_put_failure; + + if (dst->lwtstate && + lwtunnel_fill_encap(skb, dst->lwtstate, RTA_ENCAP, RTA_ENCAP_TYPE) < 0) + goto nla_put_failure; } else if (rt->fib6_nsiblings) { struct fib6_info *sibling, *next_sibling; struct nlattr *mp; |