aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-18 03:40:17 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-18 03:40:17 -0400
commitd3aaeb38c40e5a6c08dd31a1b64da65c4352be36 (patch)
tree1c17b41d11edc7a7b3477a294cba440f2a14796c /net/ipv6/route.c
parent69cce1d1404968f78b177a0314f5822d5afdbbfb (diff)
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>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 2998cb5be90b..ddef80f568b0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -127,6 +127,11 @@ static u32 *ipv6_cow_metrics(struct dst_entry *dst, unsigned long old)
127 return p; 127 return p;
128} 128}
129 129
130static struct neighbour *ip6_neigh_lookup(const struct dst_entry *dst, const void *daddr)
131{
132 return __neigh_lookup_errno(&nd_tbl, daddr, dst->dev);
133}
134
130static struct dst_ops ip6_dst_ops_template = { 135static struct dst_ops ip6_dst_ops_template = {
131 .family = AF_INET6, 136 .family = AF_INET6,
132 .protocol = cpu_to_be16(ETH_P_IPV6), 137 .protocol = cpu_to_be16(ETH_P_IPV6),
@@ -142,6 +147,7 @@ static struct dst_ops ip6_dst_ops_template = {
142 .link_failure = ip6_link_failure, 147 .link_failure = ip6_link_failure,
143 .update_pmtu = ip6_rt_update_pmtu, 148 .update_pmtu = ip6_rt_update_pmtu,
144 .local_out = __ip6_local_out, 149 .local_out = __ip6_local_out,
150 .neigh_lookup = ip6_neigh_lookup,
145}; 151};
146 152
147static unsigned int ip6_blackhole_default_mtu(const struct dst_entry *dst) 153static unsigned int ip6_blackhole_default_mtu(const struct dst_entry *dst)
@@ -168,6 +174,7 @@ static struct dst_ops ip6_dst_blackhole_ops = {
168 .default_advmss = ip6_default_advmss, 174 .default_advmss = ip6_default_advmss,
169 .update_pmtu = ip6_rt_blackhole_update_pmtu, 175 .update_pmtu = ip6_rt_blackhole_update_pmtu,
170 .cow_metrics = ip6_rt_blackhole_cow_metrics, 176 .cow_metrics = ip6_rt_blackhole_cow_metrics,
177 .neigh_lookup = ip6_neigh_lookup,
171}; 178};
172 179
173static const u32 ip6_template_metrics[RTAX_MAX] = { 180static const u32 ip6_template_metrics[RTAX_MAX] = {