aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ipv6.h5
-rw-r--r--net/ipv6/ip6_output.c4
-rw-r--r--net/ipv6/route.c12
3 files changed, 9 insertions, 12 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8f78aace0a9d..5d125c1293a9 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -520,9 +520,8 @@ extern struct dst_entry * ip6_sk_dst_lookup_flow(struct sock *sk,
520 struct flowi *fl, 520 struct flowi *fl,
521 const struct in6_addr *final_dst, 521 const struct in6_addr *final_dst,
522 bool can_sleep); 522 bool can_sleep);
523extern int ip6_dst_blackhole(struct sock *sk, 523extern struct dst_entry * ip6_dst_blackhole(struct net *net,
524 struct dst_entry **dst, 524 struct dst_entry *orig_dst);
525 struct flowi *fl);
526 525
527/* 526/*
528 * skb processing functions 527 * skb processing functions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index faf7b9d1d536..ac16f3b2a029 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1029,7 +1029,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi *fl,
1029 fl->flags |= FLOWI_FLAG_CAN_SLEEP; 1029 fl->flags |= FLOWI_FLAG_CAN_SLEEP;
1030 err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, 0); 1030 err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, 0);
1031 if (err == -EREMOTE) 1031 if (err == -EREMOTE)
1032 err = ip6_dst_blackhole(sk, &dst, fl); 1032 return ip6_dst_blackhole(sock_net(sk), dst);
1033 if (err) 1033 if (err)
1034 return ERR_PTR(err); 1034 return ERR_PTR(err);
1035 } else { 1035 } else {
@@ -1074,7 +1074,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi *fl,
1074 fl->flags |= FLOWI_FLAG_CAN_SLEEP; 1074 fl->flags |= FLOWI_FLAG_CAN_SLEEP;
1075 err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, 0); 1075 err = __xfrm_lookup(sock_net(sk), &dst, fl, sk, 0);
1076 if (err == -EREMOTE) 1076 if (err == -EREMOTE)
1077 err = ip6_dst_blackhole(sk, &dst, fl); 1077 return ip6_dst_blackhole(sock_net(sk), dst);
1078 if (err) 1078 if (err)
1079 return ERR_PTR(err); 1079 return ERR_PTR(err);
1080 } else { 1080 } else {
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 7e9443f835f9..cf6fdeabb6f2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -870,11 +870,10 @@ struct dst_entry * ip6_route_output(struct net *net, struct sock *sk,
870 870
871EXPORT_SYMBOL(ip6_route_output); 871EXPORT_SYMBOL(ip6_route_output);
872 872
873int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl) 873struct dst_entry *ip6_dst_blackhole(struct net *net, struct dst_entry *dst_orig)
874{ 874{
875 struct rt6_info *ort = (struct rt6_info *) *dstp; 875 struct rt6_info *rt = dst_alloc(&ip6_dst_blackhole_ops, 1);
876 struct rt6_info *rt = (struct rt6_info *) 876 struct rt6_info *ort = (struct rt6_info *) dst_orig;
877 dst_alloc(&ip6_dst_blackhole_ops, 1);
878 struct dst_entry *new = NULL; 877 struct dst_entry *new = NULL;
879 878
880 if (rt) { 879 if (rt) {
@@ -905,9 +904,8 @@ int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl
905 dst_free(new); 904 dst_free(new);
906 } 905 }
907 906
908 dst_release(*dstp); 907 dst_release(dst_orig);
909 *dstp = new; 908 return new ? new : ERR_PTR(-ENOMEM);
910 return new ? 0 : -ENOMEM;
911} 909}
912EXPORT_SYMBOL_GPL(ip6_dst_blackhole); 910EXPORT_SYMBOL_GPL(ip6_dst_blackhole);
913 911