Skip to contentSkip to conversation

net: ipv4: remove disable of bottom half in inet_rtm_getroute

PATCH Applied David Ahern 2 participants 2 messages Jan 8, 2017 – Jan 9, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ipv4: remove disable of bottom half in inet_rtm_getroute

Nothing about the route lookup requires bottom half to be disabled. Remove the local_bh_disable ... local_bh_enable around ip_route_input. This appears to be a vestige of days gone by as it has been there since the beginning of git time.

---
 net/ipv4/route.c | 2 --
 1 file changed, 2 deletions(-)
net/ipv4/route.c +0 -2
index f51823dc998b..7144288371cf 100644
@@ -2631,9 +2631,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
 		skb->protocol	= htons(ETH_P_IP);
 		skb->dev	= dev;
 		skb->mark	= mark;
-		local_bh_disable();
 		err = ip_route_input(skb, dst, src, rtm->rtm_tos, dev);
-		local_bh_enable();
 
 		rt = skb_rtable(skb);
 		if (err == 0 && rt->dst.error)
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw

From: David Ahern <[email protected]>
Date: Sat, 7 Jan 2017 20:04:23 -0800

Quoted 6 lines

Nothing about the route lookup requires bottom half to be disabled. Remove the local_bh_disable ... local_bh_enable around ip_route_input. This appears to be a vestige of days gone by as it has been there since the beginning of git time.

Agreed, this shouldn't be necessary.

The key with input route lookups is that the skb->dst reference cannot escape the packet receive path, unless we force the dst, which ip_route_input() does under RCU protection.

So this should all be ok.

Applied, thanks.