Changeset 9887 for trunk/src/wsock32/wsock32.cpp
- Timestamp:
- Mar 3, 2003, 5:34:39 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wsock32/wsock32.cpp
r9844 r9887 1 /* $Id: wsock32.cpp,v 1.5 1 2003-02-24 11:14:56sandervl Exp $ */1 /* $Id: wsock32.cpp,v 1.52 2003-03-03 16:34:39 sandervl Exp $ */ 2 2 3 3 /* … … 724 724 return SOCKET_ERROR; 725 725 } 726 else 727 if(fromlen == NULL || *fromlen < (int)sizeof(struct sockaddr_in)) { 728 WSASetLastError(WSAEFAULT); 729 return SOCKET_ERROR; 730 } 731 dprintf(("recvfrom to %s", inet_ntoa(((sockaddr_in*)from)->sin_addr))); 732 726 //NOTE: do not check from & fromlen; they are allowed to be NULL/0 727 728 if(from) { 729 dprintf(("recvfrom to %s", inet_ntoa(((sockaddr_in*)from)->sin_addr))); 730 } 733 731 ret = recvfrom(s, buf, len, flags, from, fromlen); 734 732 … … 822 820 return SOCKET_ERROR; 823 821 } 824 else 825 if(tolen < (int)sizeof(struct sockaddr_in)) { 826 WSASetLastError(WSAEFAULT); 827 return SOCKET_ERROR; 828 } 822 //NOTE: do not check to & tolen; they are allowed to be NULL/0 823 829 824 // check if the socket is a raw socket and has the IP_HDRINCL switch 830 825 // if this is the case, we overwrite the IP header length field with … … 837 832 *(u_short *)&buf[2] = len; 838 833 } 839 dprintf(("sending to %s", inet_ntoa(((sockaddr_in*)to)->sin_addr))); 834 if(to) { 835 dprintf(("sending to %s", inet_ntoa(((sockaddr_in*)to)->sin_addr))); 836 } 840 837 #ifdef DUMP_PACKETS 841 838 dprintf2(("Packet length %d", len));
Note:
See TracChangeset
for help on using the changeset viewer.