Skip to content

Commit c305b9e

Browse files
zhangkaihebdavem330
authored andcommitted
ipv6: delete useless dst check in ip6_dst_lookup_tail
parameter dst always points to null. Signed-off-by: zhang kai <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 911bd1b commit c305b9e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

net/ipv6/ip6_output.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,13 +1055,11 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
10551055
* ip6_route_output will fail given src=any saddr, though, so
10561056
* that's why we try it again later.
10571057
*/
1058-
if (ipv6_addr_any(&fl6->saddr) && (!*dst || !(*dst)->error)) {
1058+
if (ipv6_addr_any(&fl6->saddr)) {
10591059
struct fib6_info *from;
10601060
struct rt6_info *rt;
1061-
bool had_dst = *dst != NULL;
10621061

1063-
if (!had_dst)
1064-
*dst = ip6_route_output(net, sk, fl6);
1062+
*dst = ip6_route_output(net, sk, fl6);
10651063
rt = (*dst)->error ? NULL : (struct rt6_info *)*dst;
10661064

10671065
rcu_read_lock();
@@ -1078,7 +1076,7 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
10781076
* never existed and let the SA-enabled version take
10791077
* over.
10801078
*/
1081-
if (!had_dst && (*dst)->error) {
1079+
if ((*dst)->error) {
10821080
dst_release(*dst);
10831081
*dst = NULL;
10841082
}

0 commit comments

Comments
 (0)