diff options
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 1534508f6c68..a998db6e7895 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -113,6 +113,11 @@ static struct dst_ops ip6_dst_ops_template = { | |||
113 | .local_out = __ip6_local_out, | 113 | .local_out = __ip6_local_out, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static unsigned int ip6_blackhole_default_mtu(const struct dst_entry *dst) | ||
117 | { | ||
118 | return 0; | ||
119 | } | ||
120 | |||
116 | static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) | 121 | static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) |
117 | { | 122 | { |
118 | } | 123 | } |
@@ -122,6 +127,8 @@ static struct dst_ops ip6_dst_blackhole_ops = { | |||
122 | .protocol = cpu_to_be16(ETH_P_IPV6), | 127 | .protocol = cpu_to_be16(ETH_P_IPV6), |
123 | .destroy = ip6_dst_destroy, | 128 | .destroy = ip6_dst_destroy, |
124 | .check = ip6_dst_check, | 129 | .check = ip6_dst_check, |
130 | .default_mtu = ip6_blackhole_default_mtu, | ||
131 | .default_advmss = ip6_default_advmss, | ||
125 | .update_pmtu = ip6_rt_blackhole_update_pmtu, | 132 | .update_pmtu = ip6_rt_blackhole_update_pmtu, |
126 | }; | 133 | }; |
127 | 134 | ||
@@ -194,7 +201,6 @@ static void ip6_dst_destroy(struct dst_entry *dst) | |||
194 | in6_dev_put(idev); | 201 | in6_dev_put(idev); |
195 | } | 202 | } |
196 | if (peer) { | 203 | if (peer) { |
197 | BUG_ON(!(rt->rt6i_flags & RTF_CACHE)); | ||
198 | rt->rt6i_peer = NULL; | 204 | rt->rt6i_peer = NULL; |
199 | inet_putpeer(peer); | 205 | inet_putpeer(peer); |
200 | } | 206 | } |
@@ -204,9 +210,6 @@ void rt6_bind_peer(struct rt6_info *rt, int create) | |||
204 | { | 210 | { |
205 | struct inet_peer *peer; | 211 | struct inet_peer *peer; |
206 | 212 | ||
207 | if (WARN_ON(!(rt->rt6i_flags & RTF_CACHE))) | ||
208 | return; | ||
209 | |||
210 | peer = inet_getpeer_v6(&rt->rt6i_dst.addr, create); | 213 | peer = inet_getpeer_v6(&rt->rt6i_dst.addr, create); |
211 | if (peer && cmpxchg(&rt->rt6i_peer, NULL, peer) != NULL) | 214 | if (peer && cmpxchg(&rt->rt6i_peer, NULL, peer) != NULL) |
212 | inet_putpeer(peer); | 215 | inet_putpeer(peer); |