mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
util_sock: fix assignment of sa_socklen
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14800 Autobuild-User(master): Björn Jacke <bjacke@samba.org> Autobuild-Date(master): Tue Aug 31 09:54:35 UTC 2021 on sn-devel-184
This commit is contained in:
parent
638c6d423e
commit
1209c89dcf
@ -254,6 +254,15 @@ int open_socket_in(
|
||||
int val = rebind ? 1 : 0;
|
||||
bool ok;
|
||||
|
||||
switch (addr.u.sa.sa_family) {
|
||||
case AF_INET6:
|
||||
addr.sa_socklen = sizeof(struct sockaddr_in6);
|
||||
break;
|
||||
case AF_INET:
|
||||
addr.sa_socklen = sizeof(struct sockaddr_in);
|
||||
break;
|
||||
}
|
||||
|
||||
ok = samba_sockaddr_set_port(&addr, port);
|
||||
if (!ok) {
|
||||
ret = -EINVAL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user