ipv4: route: restore skb_dst_set in inet_rtm_getroute
Subsystems (3)
PATCH 1/1 ipv4: route: restore skb_dst_set in inet_rtm_getroute
From: Roopa Prabhu <[email protected]>
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.
--- net/ipv4/route.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/ipv4/route.c +4 -3
@@ -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;
Signature · 1 line
1.9.1
From: Roopa Prabhu <[email protected]>
Date: Wed, 31 May 2017 22:53:25 -0700
Quoted 10 lines
From: Roopa Prabhu <[email protected]>
recent updates to
inet_rtm_getroutedroppedskb_dst_setininet_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 <[email protected]>Signed-off-by David Ahern <[email protected]>Signed-off-by Roopa Prabhu <[email protected]>
Applied.
Quoted 9 lines · David Miller
From: Roopa Prabhu <[email protected]>
Date: Wed, 31 May 2017 22:53:25 -0700Quoted 6 lines
From: Roopa Prabhu <[email protected]>
recent updates to
inet_rtm_getroutedroppedskb_dst_setininet_rtm_getroute. This patch restores it because it is needed to release the dst correctly.
Quoted 7 lines
Quoted 4 lines
Fixes 3765d35ed8b9 ("net: ipv4: Convert inet_rtm_getroute to rcu versions of route lookup")Reported-by John Fastabend <[email protected]>Signed-off-by David Ahern <[email protected]>Signed-off-by Roopa Prabhu <[email protected]>Applied.
Thanks Roopa this fixes the regression on my systems.
.John