netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Oliver Herms <oliver.peter.herms@gmail.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru,
	yoshfuji@linux-ipv6.org, kuba@kernel.org
Subject: Re: [PATCH v3] IPv6: RTM_GETROUTE: Add RTA_ENCAP to result
Date: Wed, 18 Nov 2020 13:19:15 -0700	[thread overview]
Message-ID: <75cc0e7b-1922-850f-da22-550c8c90aac6@gmail.com> (raw)
In-Reply-To: <20201118151436.GA420026@tws>

On 11/18/20 8:14 AM, Oliver Herms wrote:
> 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>
> ---
>  net/ipv6/route.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 7e0ce7af8234..64bda402357b 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 && 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;
> 

You forgot to remove the dst part of that. rt6 == dst so to be in this
branch dst != NULL.

Besides that nit that maybe Jakub will fixup before applying:

Reviewed-by: David Ahern <dsahern@kernel.org>

  reply	other threads:[~2020-11-18 20:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 15:14 [PATCH v3] IPv6: RTM_GETROUTE: Add RTA_ENCAP to result Oliver Herms
2020-11-18 20:19 ` David Ahern [this message]
2020-11-18 23:08   ` Oliver Herms

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=75cc0e7b-1922-850f-da22-550c8c90aac6@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=oliver.peter.herms@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).