Linux NFS development
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: Anna Schumaker <anna.schumaker@netapp.com>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Trond Myklebust <trond.myklebust@primarydata.com>,
	asias.hejun@gmail.com, netdev@vger.kernel.org,
	Daniel Berrange <berrange@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [RFC 07/10] SUNRPC: restrict backchannel svc IPPROTO_TCP check to IP
Date: Thu,  4 Jun 2015 17:45:50 +0100	[thread overview]
Message-ID: <1433436353-6761-8-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1433436353-6761-1-git-send-email-stefanha@redhat.com>

The IPPROTO_TCP check only applies to AF_INET and AF_INET6.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 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


  parent reply	other threads:[~2015-06-04 16:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 16:45 [RFC 00/10] NFS: add AF_VSOCK support to NFS client Stefan Hajnoczi
2015-06-04 16:45 ` [RFC 01/10] SUNRPC: add AF_VSOCK support to addr.h Stefan Hajnoczi
2015-06-04 16:45 ` [RFC 02/10] SUNRPC: rename "TCP" record parser to "stream" parser Stefan Hajnoczi
2015-06-04 16:45 ` [RFC 03/10] SUNRPC: abstract tcp_read_sock() in record fragment parser Stefan Hajnoczi
2015-06-04 16:45 ` [RFC 04/10] SUNRPC: extract xs_stream_reset_state() Stefan Hajnoczi
2015-06-04 16:45 ` [RFC 05/10] VSOCK: add tcp_read_sock()-like vsock_read_sock() function Stefan Hajnoczi
2015-06-04 16:45 ` [RFC 06/10] SUNRPC: add AF_VSOCK support to xprtsock.c Stefan Hajnoczi
2015-06-04 16:45 ` Stefan Hajnoczi [this message]
2015-06-04 16:45 ` [RFC 08/10] SUNRPC: add vsock-bc backchannel Stefan Hajnoczi
2015-06-04 16:45 ` [RFC 09/10] SUNRPC: add AF_VSOCK support to svc_xprt.c Stefan Hajnoczi
2015-06-04 16:45 ` [RFC 10/10] NFS: add AF_VSOCK support to NFS client Stefan Hajnoczi
2015-06-08 21:02 ` [RFC 00/10] " J. Bruce Fields
2015-06-10 16:43   ` Stefan Hajnoczi
2015-06-10 18:09     ` J. Bruce Fields
2015-06-11  9:19       ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433436353-6761-8-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=anna.schumaker@netapp.com \
    --cc=asias.hejun@gmail.com \
    --cc=berrange@redhat.com \
    --cc=bfields@fieldses.org \
    --cc=davem@davemloft.net \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox