SourceForge.net | 5 Mar 2011 11:47
Picon
Favicon

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

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
(Continue reading)


Gmane