All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-nfs@vger.kernel.org, nfsv4@linux-nfs.org
Subject: Re: [PATCH 3/6] nfs-utils: skip getaddrinfo in create_auth_rpc_client unless we need port
Date: Mon, 6 Apr 2009 11:03:11 -0400	[thread overview]
Message-ID: <194FD47F-E529-48BD-A9BC-4CA39D9A67FB@oracle.com> (raw)
In-Reply-To: <20090403150415.3586bba3@tleilax.poochiereds.net>

On Apr 3, 2009, at 3:04 PM, Jeff Layton wrote:
> On Wed, 1 Apr 2009 14:01:30 -0400
> Chuck Lever <chuck.lever@oracle.com> wrote:
>
>> As far as I understand it, the ai_socktype and ai_protocol fields are
>> used to return the values needed for subsequent socket(2)/bind(2)
>> system calls.  In this case you are not using these fields from the
>> results...
>>
>> If ai_protocol is zero, then getaddrinfo(3) assumes you want one copy
>> of the address for each supported protocol type, so it returns three
>> structures (one for IPPROTO_UDP, one for IPPROTO_TCP, and one with a
>> zero protocol number).  The contents, except for the socktype and
>> protocol fields, are the same for each.
>
> Hypothetical situation...
>
> Suppose there is a service in /etc/services that has a different port
> number for tcp than for udp:
>
> fooserv		50001/tcp
> fooserv		50002/udp
>
> You're saying that getaddrinfo will return the same port number in all
> of the returned structures? Won't that mean that one of the port  
> numbers
> is wrong? That seems broken if so...

I was trying to describe observed behavior here -- it's pretty  
unlikely that there will be different port numbers in these returned  
structures.  It's difficult to say precisely how this is supposed to  
behave based on the man page or even browsing the glibc source code  
for a few minutes.

It's certainly possible to set up /etc/services as you suggest, but  
there is an IANA policy to assign the same port for both transports.   
As near as I can tell the reason we have the transport listed in /etc/ 
services at all is because some protocols support only one transport.   
So IMO it would be quite unlikely to encounter such a case where the  
port number depended on the transport.

> If that's not the case, then I think we need to at least set the
> ai_protocol in the hints.

Perhaps that's true.  What are the expected values of @service ?

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

  reply	other threads:[~2009-04-06 15:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-01 14:23 [PATCH 0/6] nfs-utils: convert gssd to TI-RPC and add IPv6 support (try #2) Jeff Layton
2009-04-01 14:24 ` [PATCH 1/6] nfs-utils: make getnameinfo() required for --enable-gss Jeff Layton
2009-04-01 14:24 ` [PATCH 2/6] nfs-utils: store the address given in the upcall for later use Jeff Layton
2009-04-01 16:58   ` Chuck Lever
2009-04-01 17:06     ` Jeff Layton
2009-04-01 17:14       ` Chuck Lever
2009-04-01 14:24 ` [PATCH 3/6] nfs-utils: skip getaddrinfo in create_auth_rpc_client unless we need port Jeff Layton
2009-04-01 17:11   ` Chuck Lever
2009-04-01 17:47     ` Jeff Layton
2009-04-01 18:01       ` Chuck Lever
2009-04-03 19:04         ` Jeff Layton
2009-04-06 15:03           ` Chuck Lever [this message]
2009-04-06 15:21             ` Jeff Layton
2009-04-06 15:46               ` Chuck Lever
2009-04-06 16:33                 ` Jeff Layton
2009-04-06 22:33                 ` Kevin Coffman
2009-04-06 22:59                   ` Chuck Lever
2009-04-01 14:24 ` [PATCH 4/6] nfs-utils: split out gssd rpc client creation into separate function Jeff Layton
2009-04-01 14:24 ` [PATCH 5/6] nfs-utils: when TIRPC is enabled, use new API to create RPC client Jeff Layton
2009-04-01 17:23   ` Chuck Lever
2009-04-01 14:24 ` [PATCH 6/6] nfs-utils: add IPv6 code to gssd Jeff Layton
2009-04-03 16:07 ` [PATCH 0/6] nfs-utils: convert gssd to TI-RPC and add IPv6 support (try #2) Steve Dickson
     [not found]   ` <49D63436.8010709-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-04-03 17:00     ` Jeff Layton
  -- strict thread matches above, loose matches on Subject: below --
2009-03-11 16:42 [PATCH 0/6] nfs-utils: convert gssd to TI-RPC and add IPv6 support (RFC) Jeff Layton
2009-03-11 16:42 ` [PATCH 3/6] nfs-utils: skip getaddrinfo in create_auth_rpc_client unless we need port Jeff Layton
2009-03-11 22:09   ` Chuck Lever
2009-03-12 21:48     ` 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=194FD47F-E529-48BD-A9BC-4CA39D9A67FB@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=nfsv4@linux-nfs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.