[ libetpan-Bugs-3200397 ] ipv6 support does not work properly under win

"SourceForge.net" <[email protected]> Sat, 05 Mar 2011 10:47:01 +0000
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
Bugs item #3200397, was opened at 2011-03-05 13:47
Message generated for change (Tracker Item Submitted) made by anikulin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=429696&aid=3200397&group_id=41064

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Alexandr S. Nikulin (anikulin)
Assigned to: Nobody/Anonymous (nobody)
Summary: ipv6 support does not work properly under win

Initial Comment:
The function static int verify_sock_errors(int s) in connect.c returns -1 if success under win
because, upon successful completion, getsockopt() return nonzero under Win and zero undex Unix/Linux

I suggest fix:
#ifdef WIN32
  if (getsockopt(s, SOL_SOCKET, SO_ERROR, &val, &len) == 0) { //Nonzero if the function is successful; otherwise 0
#else
  if (getsockopt(s, SOL_SOCKET, SO_ERROR, &val, &len) != 0) { //Upon successful completion, getsockopt() shall return 0; otherwise, -1 shall be returned
#endif
instead
  if (getsockopt(s, SOL_SOCKET, SO_ERROR, &val, &len) < 0) {

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=429696&aid=3200397&group_id=41064

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d