net: Add ->neigh_lookup() operation to dst_ops
In the future dst entries will be neigh-less. In that environment we need to have an easy transition point for current users of dst->neighbour outside of the packet output fast path. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -127,6 +127,11 @@ static u32 *ipv6_cow_metrics(struct dst_entry *dst, unsigned long old)
|
||||
return p;
|
||||
}
|
||||
|
||||
static struct neighbour *ip6_neigh_lookup(const struct dst_entry *dst, const void *daddr)
|
||||
{
|
||||
return __neigh_lookup_errno(&nd_tbl, daddr, dst->dev);
|
||||
}
|
||||
|
||||
static struct dst_ops ip6_dst_ops_template = {
|
||||
.family = AF_INET6,
|
||||
.protocol = cpu_to_be16(ETH_P_IPV6),
|
||||
@@ -142,6 +147,7 @@ static struct dst_ops ip6_dst_ops_template = {
|
||||
.link_failure = ip6_link_failure,
|
||||
.update_pmtu = ip6_rt_update_pmtu,
|
||||
.local_out = __ip6_local_out,
|
||||
.neigh_lookup = ip6_neigh_lookup,
|
||||
};
|
||||
|
||||
static unsigned int ip6_blackhole_default_mtu(const struct dst_entry *dst)
|
||||
@@ -168,6 +174,7 @@ static struct dst_ops ip6_dst_blackhole_ops = {
|
||||
.default_advmss = ip6_default_advmss,
|
||||
.update_pmtu = ip6_rt_blackhole_update_pmtu,
|
||||
.cow_metrics = ip6_rt_blackhole_cow_metrics,
|
||||
.neigh_lookup = ip6_neigh_lookup,
|
||||
};
|
||||
|
||||
static const u32 ip6_template_metrics[RTAX_MAX] = {
|
||||
|
Reference in New Issue
Block a user