Commit c305b9e6 authored by zhang kai's avatar zhang kai Committed by David S. Miller

ipv6: delete useless dst check in ip6_dst_lookup_tail

parameter dst always points to null.
Signed-off-by: default avatarzhang kai <zhangkaiheb@126.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 911bd1b1
...@@ -1055,12 +1055,10 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk, ...@@ -1055,12 +1055,10 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
* ip6_route_output will fail given src=any saddr, though, so * ip6_route_output will fail given src=any saddr, though, so
* that's why we try it again later. * that's why we try it again later.
*/ */
if (ipv6_addr_any(&fl6->saddr) && (!*dst || !(*dst)->error)) { if (ipv6_addr_any(&fl6->saddr)) {
struct fib6_info *from; struct fib6_info *from;
struct rt6_info *rt; struct rt6_info *rt;
bool had_dst = *dst != NULL;
if (!had_dst)
*dst = ip6_route_output(net, sk, fl6); *dst = ip6_route_output(net, sk, fl6);
rt = (*dst)->error ? NULL : (struct rt6_info *)*dst; rt = (*dst)->error ? NULL : (struct rt6_info *)*dst;
...@@ -1078,7 +1076,7 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk, ...@@ -1078,7 +1076,7 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
* never existed and let the SA-enabled version take * never existed and let the SA-enabled version take
* over. * over.
*/ */
if (!had_dst && (*dst)->error) { if ((*dst)->error) {
dst_release(*dst); dst_release(*dst);
*dst = NULL; *dst = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment