Thread (1 message) 1 message, 1 author, 2015-06-04

[RFC 07/10] SUNRPC: restrict backchannel svc IPPROTO_TCP check to IP

From: Stefan Hajnoczi <hidden>
Date: 2015-06-04 16:45:50
Also in: linux-nfs
Subsystem: kernel nfsd, sunrpc, and lockd servers, networking [general], nfs, sunrpc, and lockd clients, the rest · Maintainers: Chuck Lever, Jeff Layton, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Trond Myklebust, Anna Schumaker, Linus Torvalds

The IPPROTO_TCP check only applies to AF_INET and AF_INET6.

Signed-off-by: Stefan Hajnoczi <redacted>
---
 net/sunrpc/svc.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 78974e4..1c9c5bc 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1365,9 +1365,16 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
 	/* reset result send buffer "put" position */
 	resv->iov_len = 0;
 
-	if (rqstp->rq_prot != IPPROTO_TCP) {
-		printk(KERN_ERR "No support for Non-TCP transports!\n");
-		BUG();
+	switch (((struct sockaddr *)&rqstp->rq_addr)->sa_family) {
+	case AF_INET:
+	case AF_INET6:
+		if (rqstp->rq_prot != IPPROTO_TCP) {
+			printk(KERN_ERR "No support for Non-TCP transports!\n");
+			BUG();
+		}
+		break;
+	default:
+		break;
 	}
 
 	/*
-- 
2.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help