ipv6: Kill ndisc_get_neigh() inline helper.

It's only used in net/ipv6/route.c and the NULL device check is
superfluous for all of the existing call sites.

Just expand the __ndisc_lookup_errno() call at each location.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2011-12-03 18:29:30 -05:00
parent 3830847396
commit 04a6f4417b
2 changed files with 4 additions and 12 deletions

View File

@ -145,13 +145,4 @@ int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl,
extern void inet6_ifinfo_notify(int event, extern void inet6_ifinfo_notify(int event,
struct inet6_dev *idev); struct inet6_dev *idev);
static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const struct in6_addr *addr)
{
if (dev)
return __neigh_lookup_errno(&nd_tbl, addr, dev);
return ERR_PTR(-ENODEV);
}
#endif #endif

View File

@ -744,7 +744,8 @@ static struct rt6_info *rt6_alloc_cow(const struct rt6_info *ort,
#endif #endif
retry: retry:
neigh = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); neigh = __neigh_lookup_errno(&nd_tbl, &rt->rt6i_gateway,
rt->rt6i_dev);
if (IS_ERR(neigh)) { if (IS_ERR(neigh)) {
struct net *net = dev_net(rt->rt6i_dev); struct net *net = dev_net(rt->rt6i_dev);
int saved_rt_min_interval = int saved_rt_min_interval =
@ -1085,7 +1086,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
if (neigh) if (neigh)
neigh_hold(neigh); neigh_hold(neigh);
else { else {
neigh = ndisc_get_neigh(dev, addr); neigh = __neigh_lookup_errno(&nd_tbl, addr, dev);
if (IS_ERR(neigh)) if (IS_ERR(neigh))
neigh = NULL; neigh = NULL;
} }
@ -2082,7 +2083,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
rt->rt6i_flags |= RTF_ANYCAST; rt->rt6i_flags |= RTF_ANYCAST;
else else
rt->rt6i_flags |= RTF_LOCAL; rt->rt6i_flags |= RTF_LOCAL;
neigh = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); neigh = __neigh_lookup_errno(&nd_tbl, &rt->rt6i_gateway, rt->rt6i_dev);
if (IS_ERR(neigh)) { if (IS_ERR(neigh)) {
dst_free(&rt->dst); dst_free(&rt->dst);