Subject: Linux socket emulation change (was: CVS commit: src/sys/compat/linux/common)
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Matthias Scheler <tron@zhadum.de>
List: source-changes
Date: 09/13/2004 23:27:45
In article <20040912153256.8C5E92DA1D@cvs.netbsd.org>,
	Jaromir Dolecek <jdolecek@NetBSD.org> writes:
> 
> Module Name:	src
> Committed By:	jdolecek
> Date:		Sun Sep 12 15:32:56 UTC 2004
> 
> Modified Files:
> 	src/sys/compat/linux/common: linux_socket.c
> 
> Log Message:
> if passed sockaddr has family AF_UNSPEC, use socket family of the socket
> the sockaddr is used for
> 
> this fixes bind() problem in Linux version of Theocracy, testing
> by Thomas Klausner

This change is not correct. Calling connect() with an AF_UNSPEC
sockaddr is well defined(*) interface to unconnect a UDP socket. Your
code changes have broken this. Please fix this issue and supply and
additional commit message which addresses this bug. I suggest that you
move the "bdom == AF_UNSPEC" hack linux_sys_bind() or add a boolean
argument to linux_sa_get() which allows to (de)activate it.

	Kind regards

(*) See "Unix Network Programming" by W. Richard Stevens, page 226
    "Calling connect Multiple Times for a UDP socket".

-- 
Matthias Scheler                                  http://scheler.de/~matthias/