On Tue, Mar 23, 2010 at 05:16:07PM +0700, Neutron Soutmun wrote:
> Sorry for late response, I have something else to do,

No problem; I've been in that situation myself, too.

> but I still thinking of the solution for #557810 which the user
> parsing the hostname for listening address that case for example

Great.

> # nbd-server localhost:12345 `pwd`/nbd-file 1G -C /dev/null
> 
> which localhost may resolve in both IPv4 (127.0.0.1) and IPv6 (::1)
> Therefore, I think that if I'm using getaddrinfo() to get each information
> and add to server listening pool only if it valid, it's better, isn't it ?

Yes.

> Or localhost:12345 is only mean 127.0.0.1 port 12345 ?

I would refrain from making any special case regarding any hostname.
When the user specifies a hostname on the command line, you should
perform a lookup of that hostname and listen on the addresses returned.
If the hostname does not resolve to any address we have assigned
locally, then we will be listening to an address that can never result
in traffic; that would not be a bug in nbd-server.

So 'localhost:12345' would mean 'whatever localhost resolves to, on port
12345'. If the user makes 'localhost' resolve to '192.168.1.1', then
we'd be listening on 192.168.1.1; if the user makes 'localhost' resolve
to '::1', then we'd be listening to [::1]:12345. If it returns both
'127.0.0.1' and '::1', then we should probably listen on both, I guess.

> If it is this case, when parsing this command line should set the
> socket family to AF_INET.

Mm. Having a command line option to force either IPv6 or IPv4 could be a
good idea, but it's not critical.

> If now this case is ignored, I think I can prepare the patch for you which
> diff from git repository that I reviewed already that the patch does
> not conflict much.

Great.

Thanks for your continued work on this; it really is appreciated.

-- 
The biometric identification system at the gates of the CIA headquarters
works because there's a guard with a large gun making sure no one is
trying to fool the system.
  http://www.schneier.com/blog/archives/2009/01/biometrics.html



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to