From: Jeff Layton <jlayton@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: steved@redhat.com, chuck.lever@oracle.com
Subject: [PATCH 4/6] nfs-utils: set IPV6_V6ONLY on nfssvc IPv6 sockets
Date: Tue, 2 Jun 2009 07:43:47 -0400 [thread overview]
Message-ID: <1243943029-6400-5-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1243943029-6400-1-git-send-email-jlayton@redhat.com>
IPv6 sockets for knfsd can't be allowed to accept IPv4 packets. Set the
correct option to prevent it.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
support/nfs/nfssvc.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/support/nfs/nfssvc.c b/support/nfs/nfssvc.c
index e7f3262..1bb64f0 100644
--- a/support/nfs/nfssvc.c
+++ b/support/nfs/nfssvc.c
@@ -123,6 +123,13 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port)
rc = errno;
goto error;
}
+ if (addr->ai_family == AF_INET6 &&
+ setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on))) {
+ xlog(L_ERROR, "unable to set IPV6_V6ONLY: "
+ "errno %d (%s)\n", errno, strerror(errno));
+ rc = -errno;
+ goto error;
+ }
if (addr->ai_protocol == IPPROTO_TCP &&
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on))) {
xlog(L_ERROR, "unable to set SO_REUSEADDR on %s "
--
1.6.0.6
next prev parent reply other threads:[~2009-06-02 11:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-02 11:43 [PATCH 0/6] nfs-utils: add IPv6 support for rpc.nfsd (try #4) Jeff Layton
2009-06-02 11:43 ` [PATCH 1/6] nfs-utils: don't link libexport.a and libmisc.a to nfsd Jeff Layton
2009-06-02 11:43 ` [PATCH 2/6] nfs-utils: clean up option parsing in nfsd.c Jeff Layton
2009-06-02 11:43 ` [PATCH 3/6] nfs-utils: break up nfssvc.c into more individually callable functions Jeff Layton
2009-06-02 15:32 ` Chuck Lever
2009-06-02 18:40 ` Jeff Layton
2009-06-02 11:43 ` Jeff Layton [this message]
2009-06-02 11:43 ` [PATCH 5/6] nfs-utils: add IPv6 support to nfsd Jeff Layton
2009-06-02 15:35 ` Chuck Lever
2009-06-02 18:55 ` Jeff Layton
[not found] ` <20090602145537.04fdec57-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2009-06-02 19:13 ` Chuck Lever
2009-06-02 20:04 ` Jeff Layton
2009-06-02 11:43 ` [PATCH 6/6] nfs-utils: update the nfsd manpage Jeff Layton
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=1243943029-6400-5-git-send-email-jlayton@redhat.com \
--to=jlayton@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.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