* [PATCH v2] IPv6: RTM_GETROUTE: Add RTA_ENCAP to result
@ 2020-11-17 9:19 Oliver Herms
2020-11-17 16:47 ` David Ahern
0 siblings, 1 reply; 2+ messages in thread
From: Oliver Herms @ 2020-11-17 9:19 UTC (permalink / raw)
To: netdev; +Cc: dsahern, davem, kuznet, yoshfuji, kuba
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 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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] IPv6: RTM_GETROUTE: Add RTA_ENCAP to result
2020-11-17 9:19 [PATCH v2] IPv6: RTM_GETROUTE: Add RTA_ENCAP to result Oliver Herms
@ 2020-11-17 16:47 ` David Ahern
0 siblings, 0 replies; 2+ messages in thread
From: David Ahern @ 2020-11-17 16:47 UTC (permalink / raw)
To: Oliver Herms, netdev; +Cc: davem, kuznet, yoshfuji, kuba
On 11/17/20 2:19 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 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;
>
>
That needs to be moved down to this section:
if (rt6) {
if (rt6_flags & RTF_GATEWAY &&
nla_put_in6_addr(skb, RTA_GATEWAY, &rt6->rt6i_gateway))
goto nla_put_failure;
if (dst->dev && nla_put_u32(skb, RTA_OIF,
dst->dev->ifindex))
goto nla_put_failure;
--> add ENCAP here
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-17 16:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 9:19 [PATCH v2] IPv6: RTM_GETROUTE: Add RTA_ENCAP to result Oliver Herms
2020-11-17 16:47 ` David Ahern
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.