On Wed, Oct 29, 2008 at 08:46:28PM +0000, Jeremy Henty wrote:
On Wed, Oct 29, 2008 at 01:28:20PM -0300, Jorge Arellano Cid wrote:
On Wed, Oct 29, 2008 at 12:24:03PM +0000, Jeremy Henty wrote:
Shouldn't we delete the definition of D_SUN_LEN from the dpi programs since they don't use it? Or maybe they should use it? Which?
Given that IO/dpi.c uses both without (reported) problems, it'd be good to have everyone use D_SUN_LEN.
Actually, I think I was confused. The accept() man page says
The addrlen argument is a value-result argument: it should initially contain the size of the structure pointed to by addr; on return it will contain the actual length (in bytes) of the address returned.
So passing sizeof(struct sockarr_un) to accept() is correct. Indeed, passing D_SUN_LUN(&address) could be disastrous because address is uninitialised (since we expect accept() to fill it in). So I think the code is correct and we should just remove the unused D_SUN_LEN definitions. Patch attached.
OK, but I was talking about connect(). -- Cheers Jorge.-