net: Add a struct net parameter to sock_create_kern
This is long overdue, and is part of cleaning up how we allocate kernel sockets that don't reference count struct net. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
140e807da1
commit
eeb1bd5c40
+8
-8
@@ -921,8 +921,8 @@ static int tcp_accept_from_sock(struct connection *con)
|
||||
mutex_unlock(&connections_lock);
|
||||
|
||||
memset(&peeraddr, 0, sizeof(peeraddr));
|
||||
result = sock_create_kern(dlm_local_addr[0]->ss_family, SOCK_STREAM,
|
||||
IPPROTO_TCP, &newsock);
|
||||
result = sock_create_kern(&init_net, dlm_local_addr[0]->ss_family,
|
||||
SOCK_STREAM, IPPROTO_TCP, &newsock);
|
||||
if (result < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1173,8 +1173,8 @@ static void tcp_connect_to_sock(struct connection *con)
|
||||
goto out;
|
||||
|
||||
/* Create a socket to communicate with */
|
||||
result = sock_create_kern(dlm_local_addr[0]->ss_family, SOCK_STREAM,
|
||||
IPPROTO_TCP, &sock);
|
||||
result = sock_create_kern(&init_net, dlm_local_addr[0]->ss_family,
|
||||
SOCK_STREAM, IPPROTO_TCP, &sock);
|
||||
if (result < 0)
|
||||
goto out_err;
|
||||
|
||||
@@ -1258,8 +1258,8 @@ static struct socket *tcp_create_listen_sock(struct connection *con,
|
||||
addr_len = sizeof(struct sockaddr_in6);
|
||||
|
||||
/* Create a socket to communicate with */
|
||||
result = sock_create_kern(dlm_local_addr[0]->ss_family, SOCK_STREAM,
|
||||
IPPROTO_TCP, &sock);
|
||||
result = sock_create_kern(&init_net, dlm_local_addr[0]->ss_family,
|
||||
SOCK_STREAM, IPPROTO_TCP, &sock);
|
||||
if (result < 0) {
|
||||
log_print("Can't create listening comms socket");
|
||||
goto create_out;
|
||||
@@ -1365,8 +1365,8 @@ static int sctp_listen_for_all(void)
|
||||
|
||||
log_print("Using SCTP for communications");
|
||||
|
||||
result = sock_create_kern(dlm_local_addr[0]->ss_family, SOCK_SEQPACKET,
|
||||
IPPROTO_SCTP, &sock);
|
||||
result = sock_create_kern(&init_net, dlm_local_addr[0]->ss_family,
|
||||
SOCK_SEQPACKET, IPPROTO_SCTP, &sock);
|
||||
if (result < 0) {
|
||||
log_print("Can't create comms socket, check SCTP is loaded");
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user