Skip to content

Commit cc00bc8

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: off ipv6only for both ipv4/ipv6 binding
ΕΛΕΝΗ reported that ksmbd binds to the IPV6 wildcard (::) by default for ipv4 and ipv6 binding. So IPV4 connections are successful only when the Linux system parameter bindv6only is set to 0 [default value]. If this parameter is set to 1, then the ipv6 wildcard only represents any IPV6 address. Samba creates different sockets for ipv4 and ipv6 by default. This patch off sk_ipv6only to support IPV4/IPV6 connections without creating two sockets. Cc: stable@vger.kernel.org Reported-by: ΕΛΕΝΗ ΤΖΑΒΕΛΛΑ <helentzavellas@yahoo.gr> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent bc642d7 commit cc00bc8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/smb/server/transport_tcp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ static int create_socket(struct interface *iface)
448448
sin6.sin6_family = PF_INET6;
449449
sin6.sin6_addr = in6addr_any;
450450
sin6.sin6_port = htons(server_conf.tcp_port);
451+
452+
lock_sock(ksmbd_socket->sk);
453+
ksmbd_socket->sk->sk_ipv6only = false;
454+
release_sock(ksmbd_socket->sk);
451455
}
452456

453457
ksmbd_tcp_nodelay(ksmbd_socket);

0 commit comments

Comments
 (0)