mirror of
https://github.com/torvalds/linux.git
synced 2025-01-01 15:51:46 +00:00
mptcp: netlink: process IPv6 addrs in creating listening sockets
This change updates mptcp_pm_nl_create_listen_socket() to create
listening sockets bound to IPv6 addresses (where IPv6 is supported).
Fixes: 1729cf186d
("mptcp: create the listening socket for new port")
Acked-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
857898eb4b
commit
029744cd4b
@ -925,6 +925,7 @@ out:
|
||||
static int mptcp_pm_nl_create_listen_socket(struct sock *sk,
|
||||
struct mptcp_pm_addr_entry *entry)
|
||||
{
|
||||
int addrlen = sizeof(struct sockaddr_in);
|
||||
struct sockaddr_storage addr;
|
||||
struct mptcp_sock *msk;
|
||||
struct socket *ssock;
|
||||
@ -949,8 +950,11 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk,
|
||||
}
|
||||
|
||||
mptcp_info2sockaddr(&entry->addr, &addr, entry->addr.family);
|
||||
err = kernel_bind(ssock, (struct sockaddr *)&addr,
|
||||
sizeof(struct sockaddr_in));
|
||||
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
|
||||
if (entry->addr.family == AF_INET6)
|
||||
addrlen = sizeof(struct sockaddr_in6);
|
||||
#endif
|
||||
err = kernel_bind(ssock, (struct sockaddr *)&addr, addrlen);
|
||||
if (err) {
|
||||
pr_warn("kernel_bind error, err=%d", err);
|
||||
goto out;
|
||||
|
Loading…
Reference in New Issue
Block a user