[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] [patch] errors on 3.2 under FreeBSD

Hi Hirohisa-san,

On 05-04-13 17:56, Hirohisa Yamaguchi wrote:
> I'm sorry, but my previous patch had an inverted condition.
> I attach updated patch.

I realize I asked for this on ports@...1328..., but in the mean time
I've been looking at it myself some more.

I'm afraid there are some portability issues with nbd-server as it is
currently. Your patch hides some of them (by making the test suite
succeed in the face of an obvious bug -- that the server isn't listening
on both IPv4 and IPv6 when we ask it to), and breaks nbd-server for
Linux in others (I hereby decide that I hate getopt).

I can't accept a patch with that result. I'm sure you understand :-)

The first issue is a case of misunderstanding how things are *supposed*
to work. Opening one "modern" socket for both IPv4 and IPv6 just happens
to work on Linux, but that isn't required. If we want to be portable, we
need to manage *all* results from getaddrinfo(), not just the first.
I'll look into that today (or maybe tomorrow).

The second is somewhat uglier. Apparently there's no real standard for
how getopt() implementations are supposed to handle non-option
arguments; the way GNU getopt does it, is completely incompatible with
how FreeBSD getopt does. I had a stab at making it work for both, but
noticed today that the test suite failed on my laptop -- clearly I was
mistaken in my attempt. Since GNU getopt is available in a separate
library, I'll just change the configure script to have it require GNU
getopt instead. That's the chickening out way, but it has the advantage
of not requiring too much code changes.


Copyshops should do vouchers. So that next time some bureaucracy
requires you to mail a form in triplicate, you can mail it just once,
add a voucher, and save on postage.

Reply to: