Skip to content

Commit b4dd006

Browse files
Eric Dumazetdavem330
Eric Dumazet
authored andcommitted
ipv6: fix inet6_csk_update_pmtu() return value
In case of error, inet6_csk_update_pmtu() should consistently return NULL. Bug added in commit 35ad9b9 (ipv6: Add helper inet6_csk_update_pmtu().) Reported-by: Lluís Batlle i Rossell <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3e2f61c commit b4dd006

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv6/inet6_connection_sock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu)
252252
return NULL;
253253
dst->ops->update_pmtu(dst, sk, NULL, mtu);
254254

255-
return inet6_csk_route_socket(sk, &fl6);
255+
dst = inet6_csk_route_socket(sk, &fl6);
256+
return IS_ERR(dst) ? NULL : dst;
256257
}
257258
EXPORT_SYMBOL_GPL(inet6_csk_update_pmtu);

0 commit comments

Comments
 (0)