From 1a22019e6a86d0636f9847f8891f280facd2fd22 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 28 Sep 2014 16:05:17 +0200 Subject: BSD apps want sin_zero cleared in sys_getname. Cherry-picked from Linux c1e9dcb37795b08a1f50b8de7b2ad5efcb15728f * pfinet/linux-src/net/ipv4/af_inet.c (inet_getname): Clear `sin_zero' part of `sin'. --- pfinet/linux-src/net/ipv4/af_inet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pfinet/linux-src/net/ipv4/af_inet.c b/pfinet/linux-src/net/ipv4/af_inet.c index 04e05107..0e52a72c 100644 --- a/pfinet/linux-src/net/ipv4/af_inet.c +++ b/pfinet/linux-src/net/ipv4/af_inet.c @@ -755,6 +755,7 @@ static int inet_getname(struct socket *sock, struct sockaddr *uaddr, sin->sin_port = sk->sport; sin->sin_addr.s_addr = addr; } + memset(sin->sin_zero, 0, sizeof(sin->sin_zero)); *uaddr_len = sizeof(*sin); return(0); } -- cgit v1.2.3