Re: Undefined behaviour of connect(fd, NULL, 0);

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Neil Brown
Date: Wednesday, March 31, 2010 - 8:38 pm

On Thu, 1 Apr 2010 11:00:23 +0800
Changli Gao <xiaosuo@gmail.com> wrote:



I'm not sure I'd say that I "want" any particular patch.
I just want to know what "connect(fd, NULL, 0)" is supposed to do, and to
have the kernel be consistent in its behaviour.  I'm not really fussed what
the behaviour is.

I suspect the customer wants that patch you have supplied as it would mean
they don't need to change their code.  But I only want it if it is "right".

The patch you have provided does what I had assumed Stephen's patch did
before I actually read it properly.

My feeling is that this patch might be more useful than Stephen's as having
connect(fd, NULL, 0) do what the customer expects seems useful, where as
having it do the same as setting AF_UNSPEC doesn't add anything.

I've googled around a bit but cannot find any evidence of anyone passing NULL
to connect like this, and what documentation I can find doesn't really
address the issue at all.

Thanks,
NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Undefined behaviour of connect(fd, NULL, 0);, Neil Brown, (Wed Mar 31, 4:36 am)
Re: Undefined behaviour of connect(fd, NULL, 0);, Stephen Hemminger, (Wed Mar 31, 11:49 am)
Re: Undefined behaviour of connect(fd, NULL, 0);, Neil Brown, (Wed Mar 31, 1:24 pm)
Re: Undefined behaviour of connect(fd, NULL, 0);, Stephen Hemminger, (Wed Mar 31, 2:14 pm)
Re: Undefined behaviour of connect(fd, NULL, 0);, David Miller, (Wed Mar 31, 2:17 pm)
Re: Undefined behaviour of connect(fd, NULL, 0);, Neil Brown, (Wed Mar 31, 3:07 pm)
Re: Undefined behaviour of connect(fd, NULL, 0);, Changli Gao, (Wed Mar 31, 8:00 pm)
Re: Undefined behaviour of connect(fd, NULL, 0);, Neil Brown, (Wed Mar 31, 8:38 pm)
Re: Undefined behaviour of connect(fd, NULL, 0);, Changli Gao, (Wed Mar 31, 9:16 pm)
Re: Undefined behaviour of connect(fd, NULL, 0);, Changli Gao, (Wed Mar 31, 10:50 pm)
Re: Undefined behaviour of connect(fd, NULL, 0);, David Miller, (Thu Apr 1, 12:23 am)
Re: Undefined behaviour of connect(fd, NULL, 0);, Changli Gao, (Mon Apr 5, 2:23 am)
Re: Undefined behaviour of connect(fd, NULL, 0);, Eric Dumazet, (Mon Apr 5, 8:56 am)
Re: Undefined behaviour of connect(fd, NULL, 0);, Andreas Schwab, (Mon Apr 5, 9:25 am)
Re: Undefined behaviour of connect(fd, NULL, 0);, David Miller, (Mon Apr 5, 12:25 pm)