Changeset 2516
- Timestamp:
- Feb 4, 2006, 1:26:03 PM (20 years ago)
- Location:
- branches/libc-0.6/src/emx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/ChangeLog.LIBC
r2515 r2516 4 4 5 5 2006-02-04: knut st. osmundsen <bird-gccos2-spam@anduin.net> 6 - libsocket: 7 o #25: Ensure correct address length returns from recvmsg and recvfrom. 6 8 - libc: 7 9 o #32: Fixed incorrect readdir_r return code when out of files. -
branches/libc-0.6/src/emx/src/libsocket/recvfrom.c
r1517 r2516 30 30 #include "libc-alias.h" 31 31 #include <errno.h> 32 #include <netinet/in.h> 32 33 #include <sys/socket.h> 33 34 #include <sys/fcntl.h> … … 47 48 rc = __libsocket_recvfrom(pFHSocket->iSocket, buf, len, flags, from, fromlen); 48 49 if (rc >= 0) 50 { 51 if (from && fromlen) 52 { 53 #ifdef TCPV40HDRS 54 if (*fromlen > sizeof(struct sockaddr_in) && from->sa_family == AF_INET) 55 *fromlen = sizeof(struct sockaddr_in); 56 #else 57 if (*fromlen > from->sa_len) 58 *fromlen = from->sa_len; 59 #endif 60 } 49 61 LIBCLOG_RETURN_INT(rc); 62 } 50 63 __libc_TcpipUpdateErrno(); 51 64 } -
branches/libc-0.6/src/emx/src/libsocket/recvmsg.c
r1454 r2516 31 31 #include <errno.h> 32 32 #include <sys/socket.h> 33 #include <netinet/in.h> 33 34 #include <sys/fcntl.h> 34 35 #include <emx/io.h> … … 46 47 rc = __libsocket_recvmsg(pFHSocket->iSocket, msg, flags); 47 48 if (rc >= 0) 49 { 50 /* Workaround for missing msg_namelen update. Required if a IPV6 sized buffer is given. 51 * (This problem hasn't been explored well enough, so this workaround is rather cautious.) 52 */ 53 if (msg) 54 { 55 struct sockaddr_in *pAddr = (struct sockaddr_in *)msg->msg_name; 56 #ifndef TCPV40HDRS 57 if (pAddr && msg->msg_namelen > pAddr->sin_len) 58 msg->msg_namelen = pAddr->sin_len; 59 #else 60 61 if ( pAddr 62 && pAddr->sin_family == AF_INET 63 && msg->msg_namelen > sizeof(struct sockaddr_in)) 64 msg->msg_namelen = sizeof(struct sockaddr_in); 65 #endif 66 67 } 48 68 LIBCLOG_RETURN_INT(rc); 69 } 49 70 __libc_TcpipUpdateErrno(); 50 71 }
Note:
See TracChangeset
for help on using the changeset viewer.