Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Apr 2003 07:39:32 -0700
From:      Luigi Rizzo <rizzo@icir.org>
To:        stable@freebsd.org
Subject:   weird behaviour of bind() with sin_family=0
Message-ID:  <20030420073932.A52742@xorpc.icir.org>

next in thread | raw e-mail | index | archive | help
Hi,
i have some code (which works on FreeBSD) which was supposed to
do a bind() of a UDP socket on address 0.0.0.0/5678
When running it under cygwin, i got a bind() error which made
me notice that i forgot to set sin_family = PF_INET, 
resulting in a value of 0 (which corresponds to AF_UNSPEC)
in that field. Cygwin complains
at runtime with "unsupported protocol family", whereas
FreeBSD succeeds in binding to the UDP socket.

Is this to be considered a feature or a bug ?
And, any idea on why it works like this ?

	cheers
	luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030420073932.A52742>