aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-01 17:45:33 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-01 17:45:33 -0500
commit69ead7afdf6028184f713a77376ee26f8aaafdcd (patch)
treebd5cd86f9786daadfd5425f65106bd1c7383fcc7 /net/ipv6/route.c
parent80c0bc9e37adfc892af82cb6aa8cace79f8a96cb (diff)
ipv6: Normalize arguments to ip6_dst_blackhole().
Return a dst pointer which is potentitally error encoded. Don't pass original dst pointer by reference, pass a struct net instead of a socket, and elide the flow argument since it is unnecessary. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 7e9443f835f..cf6fdeabb6f 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