[Libguestfs] [PATCH nbdkit 4/4] reflection: Enhance plugin to support client address mode.

Eric Blake eblake at redhat.com
Tue Sep 17 10:52:50 UTC 2019


On 9/17/19 3:14 AM, Richard W.M. Jones wrote:
> On Mon, Sep 16, 2019 at 11:01:49AM -0500, Eric Blake wrote:
>> On 9/15/19 9:55 AM, Richard W.M. Jones wrote:
>>> +Another use for the reflection plugin is to send back the client's IP
>>> +address:
>>> +
>>> + $ nbdkit reflection mode=address
>>> + $ nbdsh -u 'nbd://localhost' -c 'print(h.pread(h.get_size(), 0))'
>>> +
>>> +which will print something like:
>>> +
>>> + b'[::1]:58912'
>>
>> Do we want a mode that attempts to do DNS lookup to convert an address
>> back to a name, so that this could result in b'localhost:58912'?
> 
> I suppose this could reveal too much information about the server's
> (DNS?) configuration?

Probably true; the client can do the reverse lookup after the fact (but
then it is the client's configuration, not the server's, that matters).


> We do have a few tests which use localhost, but they occasionally fail
> in Koji especially because our algorithm to pick a free port is racy:
> 
> https://github.com/libguestfs/nbdkit/blob/03a2cc3d766edb17011dafe939e53d0f60f1c99b/tests/functions.sh.in#L128
> 
> As far as I know there's not a good way to fix this except to have
> nbdkit choose a port, but that way is problematic in other ways.
> Perhaps there is some way to have an external process hang on to a
> port and pass it to nbdkit (using -s?)

Probably.  Another thing I might play with today.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190917/f1dd3af0/attachment.sig>


More information about the Libguestfs mailing list