* [PATCH v2] IPv4: RTM_GETROUTE: Add RTA_ENCAP to result
@ 2020-11-13 8:55 Oliver Herms
2020-11-13 16:44 ` David Ahern
0 siblings, 1 reply; 3+ messages in thread
From: Oliver Herms @ 2020-11-13 8:55 UTC (permalink / raw)
To: netdev; +Cc: davem, kuznet, yoshfuji, kuba
This patch adds an IPv4 routes encapsulation attribute
to the result of netlink RTM_GETROUTE requests
(e.g. ip route get 192.0.2.1).
Signed-off-by: Oliver Herms <oliver.peter.herms@gmail.com>
---
net/ipv4/route.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1d7076b78e63..0fbb4adee3d4 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2860,6 +2860,9 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
if (rt->dst.dev &&
nla_put_u32(skb, RTA_OIF, rt->dst.dev->ifindex))
goto nla_put_failure;
+ if (rt->dst.lwtstate &&
+ lwtunnel_fill_encap(skb, rt->dst.lwtstate, RTA_ENCAP, RTA_ENCAP_TYPE) < 0)
+ goto nla_put_failure;
#ifdef CONFIG_IP_ROUTE_CLASSID
if (rt->dst.tclassid &&
nla_put_u32(skb, RTA_FLOW, rt->dst.tclassid))
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] IPv4: RTM_GETROUTE: Add RTA_ENCAP to result
2020-11-13 8:55 [PATCH v2] IPv4: RTM_GETROUTE: Add RTA_ENCAP to result Oliver Herms
@ 2020-11-13 16:44 ` David Ahern
2020-11-15 0:07 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2020-11-13 16:44 UTC (permalink / raw)
To: Oliver Herms, netdev; +Cc: davem, kuznet, yoshfuji, kuba
On 11/13/20 1:55 AM, Oliver Herms wrote:
> This patch adds an IPv4 routes encapsulation attribute
> to the result of netlink RTM_GETROUTE requests
> (e.g. ip route get 192.0.2.1).
>
> Signed-off-by: Oliver Herms <oliver.peter.herms@gmail.com>
> ---
> net/ipv4/route.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 1d7076b78e63..0fbb4adee3d4 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2860,6 +2860,9 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
> if (rt->dst.dev &&
> nla_put_u32(skb, RTA_OIF, rt->dst.dev->ifindex))
> goto nla_put_failure;
> + if (rt->dst.lwtstate &&
> + lwtunnel_fill_encap(skb, rt->dst.lwtstate, RTA_ENCAP, RTA_ENCAP_TYPE) < 0)
> + goto nla_put_failure;
> #ifdef CONFIG_IP_ROUTE_CLASSID
> if (rt->dst.tclassid &&
> nla_put_u32(skb, RTA_FLOW, rt->dst.tclassid))
>
Reviewed-by: David Ahern <dsahern@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] IPv4: RTM_GETROUTE: Add RTA_ENCAP to result
2020-11-13 16:44 ` David Ahern
@ 2020-11-15 0:07 ` Jakub Kicinski
0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-11-15 0:07 UTC (permalink / raw)
To: David Ahern; +Cc: Oliver Herms, netdev, davem, kuznet, yoshfuji
On Fri, 13 Nov 2020 09:44:38 -0700 David Ahern wrote:
> On 11/13/20 1:55 AM, Oliver Herms wrote:
> > This patch adds an IPv4 routes encapsulation attribute
> > to the result of netlink RTM_GETROUTE requests
> > (e.g. ip route get 192.0.2.1).
> >
> > Signed-off-by: Oliver Herms <oliver.peter.herms@gmail.com>
>
> Reviewed-by: David Ahern <dsahern@kernel.org>
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-15 0:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 8:55 [PATCH v2] IPv4: RTM_GETROUTE: Add RTA_ENCAP to result Oliver Herms
2020-11-13 16:44 ` David Ahern
2020-11-15 0:07 ` Jakub Kicinski
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.