diff --git a/net/socket.c b/net/socket.c index c2e0a22f16d9..d281a7ef4b1d 100644 --- a/net/socket.c +++ b/net/socket.c @@ -3507,7 +3507,11 @@ EXPORT_SYMBOL(kernel_accept); int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen, int flags) { - return sock->ops->connect(sock, addr, addrlen, flags); + struct sockaddr_storage address; + + memcpy(&address, addr, addrlen); + + return sock->ops->connect(sock, (struct sockaddr *)&address, addrlen, flags); } EXPORT_SYMBOL(kernel_connect);