|
@@ -1245,9 +1245,12 @@ EXPORT_SYMBOL_GPL(ip6_route_output_flags);
|
|
struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_orig)
|
|
struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_orig)
|
|
{
|
|
{
|
|
struct rt6_info *rt, *ort = (struct rt6_info *) dst_orig;
|
|
struct rt6_info *rt, *ort = (struct rt6_info *) dst_orig;
|
|
|
|
+ struct net_device *loopback_dev = net->loopback_dev;
|
|
struct dst_entry *new = NULL;
|
|
struct dst_entry *new = NULL;
|
|
|
|
|
|
- rt = dst_alloc(&ip6_dst_blackhole_ops, ort->dst.dev, 1, DST_OBSOLETE_NONE, 0);
|
|
|
|
|
|
+
|
|
|
|
+ rt = dst_alloc(&ip6_dst_blackhole_ops, loopback_dev, 1,
|
|
|
|
+ DST_OBSOLETE_NONE, 0);
|
|
if (rt) {
|
|
if (rt) {
|
|
rt6_info_init(rt);
|
|
rt6_info_init(rt);
|
|
|
|
|
|
@@ -1257,10 +1260,8 @@ struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_ori
|
|
new->output = dst_discard_out;
|
|
new->output = dst_discard_out;
|
|
|
|
|
|
dst_copy_metrics(new, &ort->dst);
|
|
dst_copy_metrics(new, &ort->dst);
|
|
- rt->rt6i_idev = ort->rt6i_idev;
|
|
|
|
- if (rt->rt6i_idev)
|
|
|
|
- in6_dev_hold(rt->rt6i_idev);
|
|
|
|
|
|
|
|
|
|
+ rt->rt6i_idev = in6_dev_get(loopback_dev);
|
|
rt->rt6i_gateway = ort->rt6i_gateway;
|
|
rt->rt6i_gateway = ort->rt6i_gateway;
|
|
rt->rt6i_flags = ort->rt6i_flags & ~RTF_PCPU;
|
|
rt->rt6i_flags = ort->rt6i_flags & ~RTF_PCPU;
|
|
rt->rt6i_metric = 0;
|
|
rt->rt6i_metric = 0;
|