All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Herms <oliver.peter.herms@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru,
	yoshfuji@linux-ipv6.org, kuba@kernel.org
Subject: [PATCH] IPv6: RTM_GETROUTE: Add RTA_ENCAP to result
Date: Sun, 15 Nov 2020 11:55:27 +0100	[thread overview]
Message-ID: <20201115105527.GA11569@tws> (raw)

This patch adds an IPv6 routes encapsulation attribute
to the result of netlink RTM_GETROUTE requests
(e.g. ip route get 2001:db8::).

Signed-off-by: Oliver Herms <oliver.peter.herms@gmail.com>
---
 net/ipv6/route.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 82cbb46a2a4f..4d45696a70eb 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -5489,6 +5489,11 @@ 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


             reply	other threads:[~2020-11-15 10:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-15 10:55 Oliver Herms [this message]
2020-11-17  1:46 ` [PATCH] IPv6: RTM_GETROUTE: Add RTA_ENCAP to result Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201115105527.GA11569@tws \
    --to=oliver.peter.herms@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.