aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svcsock.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r--net/sunrpc/svcsock.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 953aff89bcac..5b0fe1b66a23 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1030,7 +1030,7 @@ svc_tcp_sendto(struct svc_rqst *rqstp)
1030{ 1030{
1031 struct xdr_buf *xbufp = &rqstp->rq_res; 1031 struct xdr_buf *xbufp = &rqstp->rq_res;
1032 int sent; 1032 int sent;
1033 u32 reclen; 1033 __be32 reclen;
1034 1034
1035 /* Set up the first element of the reply kvec. 1035 /* Set up the first element of the reply kvec.
1036 * Any other kvecs that may be in use have been taken 1036 * Any other kvecs that may be in use have been taken
@@ -1393,14 +1393,12 @@ svc_create_socket(struct svc_serv *serv, int protocol, struct sockaddr_in *sin)
1393 if ((error = sock_create_kern(PF_INET, type, protocol, &sock)) < 0) 1393 if ((error = sock_create_kern(PF_INET, type, protocol, &sock)) < 0)
1394 return error; 1394 return error;
1395 1395
1396 if (sin != NULL) { 1396 if (type == SOCK_STREAM)
1397 if (type == SOCK_STREAM) 1397 sock->sk->sk_reuse = 1; /* allow address reuse */
1398 sock->sk->sk_reuse = 1; /* allow address reuse */ 1398 error = kernel_bind(sock, (struct sockaddr *) sin,
1399 error = kernel_bind(sock, (struct sockaddr *) sin, 1399 sizeof(*sin));
1400 sizeof(*sin)); 1400 if (error < 0)
1401 if (error < 0) 1401 goto bummer;
1402 goto bummer;
1403 }
1404 1402
1405 if (protocol == IPPROTO_TCP) { 1403 if (protocol == IPPROTO_TCP) {
1406 if ((error = kernel_listen(sock, 64)) < 0) 1404 if ((error = kernel_listen(sock, 64)) < 0)