From: NeilBrown <neilb@suse.de>
To: greearb@candelatech.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfs-utils: Support binding to source address.
Date: Thu, 9 Jun 2011 15:47:19 +1000 [thread overview]
Message-ID: <20110609154719.5be627ca@notabene.brown> (raw)
In-Reply-To: <1307554748-31757-1-git-send-email-greearb@candelatech.com>
On Wed, 8 Jun 2011 10:39:08 -0700 greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> This lets one specify the source IP address for
> sockets, allowing users to leverage routing rules
> on multi-homed systems.
>
I gotta say I think this is rather horrible.....
As I understand it, the problem is bindresvport.
It binds to a port number before making a connection, so the local address
that is bound to is the 'default' rather than the best one to reach the given
target. And in some network configs this can be bad, because e.g. the target
may not be able to reply to that 'default' address.
So you want to be able to specify the local endpoint fully when you bind, so
you require/allow the user to specify the local endpoint.
Wouldn't it be soooo much nicer if the tools could just figure out the
'correct' local endpoint and just use that? Obviously "yes" but maybe that
isn't straight forward. Have you looked into that at all?
Worst case (which may be so incredibly bad it isn't worth considering) is
that we could extract the routing table from the kernel and "figure it out".
But I suspect there is an easier way... What if you create a UDP socket,
'connect' to some arbitrary port on the target machine, and then use
getsockname to get the local endpoint address of that socket. That wouldn't
generate any network traffic, but should give you the preferred local
endpoint for talking to that peer??
For the in-kernel code I wouldn't accept a trick like that, but there is
presumably some way to find the preferred local endpoint for some address
more directly ... certainly worth asking on net-dev if we cannot figure one
out.
So I'm thinking: yes, there is a real need, but I think there must be a
better solution.
What think you?
Thanks,
NeilBrown
next prev parent reply other threads:[~2011-06-09 5:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-08 17:39 [PATCH] nfs-utils: Support binding to source address greearb
2011-06-08 18:36 ` Jim Rees
2011-06-08 18:39 ` Ben Greear
2011-06-08 20:45 ` Chuck Lever
2011-06-08 19:11 ` J. Bruce Fields
2011-06-08 19:17 ` Ben Greear
2011-06-08 20:41 ` Chuck Lever
2011-06-08 20:54 ` Ben Greear
2011-06-08 21:16 ` Chuck Lever
2011-06-08 21:30 ` Ben Greear
2011-06-09 5:47 ` NeilBrown [this message]
2011-06-09 6:12 ` Ben Greear
2011-06-09 6:38 ` NeilBrown
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=20110609154719.5be627ca@notabene.brown \
--to=neilb@suse.de \
--cc=greearb@candelatech.com \
--cc=linux-nfs@vger.kernel.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.