[CRIU] [PATCH 2/2] sk-inet: No need for 128 byte address

Cyrill Gorcunov gorcunov at openvz.org
Tue Oct 30 12:38:45 EDT 2012


We expect to get ENOTCONN here so no need
for 128 byte address on stack.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 sk-inet.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sk-inet.c b/sk-inet.c
index 500aa63..a9d9b80 100644
--- a/sk-inet.c
+++ b/sk-inet.c
@@ -156,7 +156,7 @@ static int can_dump_inet_sk(const struct inet_sk_desc *sk)
 static struct inet_sk_desc *gen_uncon_sk(int lfd, const struct fd_parms *p)
 {
 	struct inet_sk_desc *sk;
-	char address[128];
+	char address;
 	socklen_t aux;
 	int ret;
 
@@ -166,7 +166,7 @@ static struct inet_sk_desc *gen_uncon_sk(int lfd, const struct fd_parms *p)
 
 	/* It should has no peer name */
 	aux = sizeof(address);
-	ret = getsockopt(lfd, SOL_SOCKET, SO_PEERNAME, address, &aux);
+	ret = getsockopt(lfd, SOL_SOCKET, SO_PEERNAME, &address, &aux);
 	if (ret < 0) {
 		if (errno != ENOTCONN) {
 			pr_perror("Unexpected error returned from unconnected socket");
-- 
1.7.7.6



More information about the CRIU mailing list