* [PATCH net-next] ipv4: route: restore skb_dst_set in inet_rtm_getroute
@ 2017-06-01 5:53 Roopa Prabhu
2017-06-01 15:34 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Roopa Prabhu @ 2017-06-01 5:53 UTC (permalink / raw)
To: davem; +Cc: netdev, john.fastabend, dsahern
From: Roopa Prabhu <roopa@cumulusnetworks.com>
recent updates to inet_rtm_getroute dropped skb_dst_set in
inet_rtm_getroute. This patch restores it because it is
needed to release the dst correctly.
Fixes: 3765d35ed8b9 ("net: ipv4: Convert inet_rtm_getroute to rcu versions of route lookup")
Reported-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
net/ipv4/route.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f1f2e5a..9b38cf1 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2547,8 +2547,9 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
/* called with rcu_read_lock held */
static int rt_fill_info(struct net *net, __be32 dst, __be32 src, u32 table_id,
struct flowi4 *fl4, struct sk_buff *skb, u32 portid,
- u32 seq, struct rtable *rt)
+ u32 seq)
{
+ struct rtable *rt = skb_rtable(skb);
struct rtmsg *r;
struct nlmsghdr *nlh;
unsigned long expires = 0;
@@ -2750,6 +2751,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
if (err)
goto errout_free;
+ skb_dst_set(skb, &rt->dst);
if (rtm->rtm_flags & RTM_F_NOTIFY)
rt->rt_flags |= RTCF_NOTIFY;
@@ -2763,8 +2765,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
fl4.flowi4_tos, res.fi, 0);
else
err = rt_fill_info(net, dst, src, table_id, &fl4, skb,
- NETLINK_CB(in_skb).portid, nlh->nlmsg_seq,
- rt);
+ NETLINK_CB(in_skb).portid, nlh->nlmsg_seq);
if (err < 0)
goto errout_free;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ipv4: route: restore skb_dst_set in inet_rtm_getroute
2017-06-01 5:53 [PATCH net-next] ipv4: route: restore skb_dst_set in inet_rtm_getroute Roopa Prabhu
@ 2017-06-01 15:34 ` David Miller
2017-06-01 19:43 ` John Fastabend
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2017-06-01 15:34 UTC (permalink / raw)
To: roopa; +Cc: netdev, john.fastabend, dsahern
From: Roopa Prabhu <roopa@cumulusnetworks.com>
Date: Wed, 31 May 2017 22:53:25 -0700
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> recent updates to inet_rtm_getroute dropped skb_dst_set in
> inet_rtm_getroute. This patch restores it because it is
> needed to release the dst correctly.
>
> Fixes: 3765d35ed8b9 ("net: ipv4: Convert inet_rtm_getroute to rcu versions of route lookup")
> Reported-by: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: David Ahern <dsahern@gmail.com>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ipv4: route: restore skb_dst_set in inet_rtm_getroute
2017-06-01 15:34 ` David Miller
@ 2017-06-01 19:43 ` John Fastabend
0 siblings, 0 replies; 3+ messages in thread
From: John Fastabend @ 2017-06-01 19:43 UTC (permalink / raw)
To: David Miller, roopa; +Cc: netdev, dsahern
On 06/01/2017 08:34 AM, David Miller wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
> Date: Wed, 31 May 2017 22:53:25 -0700
>
>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>
>> recent updates to inet_rtm_getroute dropped skb_dst_set in
>> inet_rtm_getroute. This patch restores it because it is
>> needed to release the dst correctly.
>>
>> Fixes: 3765d35ed8b9 ("net: ipv4: Convert inet_rtm_getroute to rcu versions of route lookup")
>> Reported-by: John Fastabend <john.fastabend@gmail.com>
>> Signed-off-by: David Ahern <dsahern@gmail.com>
>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> Applied.
>
Thanks Roopa this fixes the regression on my systems.
.John
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-01 19:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-01 5:53 [PATCH net-next] ipv4: route: restore skb_dst_set in inet_rtm_getroute Roopa Prabhu
2017-06-01 15:34 ` David Miller
2017-06-01 19:43 ` John Fastabend
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).