diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-12-15 17:08:20 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-12-15 17:08:20 +0000 |
commit | 2f5d8f7bd063cf15cfd5756ee175061490af5f92 (patch) | |
tree | 5d6f4157eb85e82070b09928281096bc36c2156d /winsup | |
parent | f04f6d49fad03fb6efa351ded13cb93a0caeed1f (diff) | |
download | newlib-2f5d8f7bd063cf15cfd5756ee175061490af5f92.zip newlib-2f5d8f7bd063cf15cfd5756ee175061490af5f92.tar.gz newlib-2f5d8f7bd063cf15cfd5756ee175061490af5f92.tar.bz2 |
* net.cc (cygwin_setsockopt): Only skip calling setsockopt(SO_REUSEADDR)
on stream sockets under systems supporting enhanced socket security.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/net.cc | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f089a10..e715d6a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-12-15 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_setsockopt): Only skip calling setsockopt(SO_REUSEADDR) + on stream sockets under systems supporting enhanced socket security. + 2009-12-15 Thomas Wolff <towo@towo.net> * fhandler_console.cc (char_command): Fix code to select dim mode diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 61a9157..a7f913a 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -693,11 +693,12 @@ cygwin_setsockopt (int fd, int level, int optname, const void *optval, optname = convert_ws1_ip_optname (optname); /* On systems supporting "enhanced socket security (2K3 and later), - the default behaviour of socket binding is equivalent to the POSIX - behaviour with SO_REUSEADDR. Setting SO_REUSEADDR would only result - in wrong behaviour. See also fhandler_socket::bind(). */ + the default behaviour of stream socket binding is equivalent to the + POSIX behaviour with SO_REUSEADDR. Setting SO_REUSEADDR would only + result in wrong behaviour. See also fhandler_socket::bind(). */ if (level == SOL_SOCKET && optname == SO_REUSEADDR - && wincap.has_enhanced_socket_security ()) + && wincap.has_enhanced_socket_security () + && fh->get_socket_type () == SOCK_STREAM) res = 0; else res = setsockopt (fh->get_socket (), level, optname, |