Changeset 23004 in vbox
- Timestamp:
- Sep 14, 2009 2:03:27 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/socket.c
r22946 r23004 564 564 struct ethhdr *eh; 565 565 ssize_t len; 566 u_long n ;566 u_long n = 0; 567 567 #ifdef VBOX_WITH_SLIRP_BSD_MBUF 568 568 uint8_t *buffer; … … 589 589 /* if (so->so_fport != htons(53)) */ 590 590 { 591 ioctlsocket(so->s, FIONREAD, &n); 592 593 if (n > len) 591 static int signaled = 0; 592 int rc = ioctlsocket(so->s, FIONREAD, &n); 593 594 if (rc == -1 && signaled == 0) 595 { 596 LogRel(("NAT: can't fetch amount of bytes on socket %R[natsock], so message will be truncated.\n", so)); 597 signaled = 1; 598 } 599 600 if (rc > 0 && n > len) 594 601 { 595 602 n = (m->m_data - m->m_dat) + m->m_len + n + 1; … … 1210 1217 struct sockaddr_in addr; 1211 1218 socklen_t addrlen = sizeof(struct sockaddr_in); 1212 char buff[1500]; 1213 int len; 1214 len = recvfrom(so->s, buff, 1500, 0, 1219 char *buff; 1220 int len = 0; 1221 int rc = 0; 1222 static int signalled = 0; 1223 rc = ioctlsocket(so->s, FIONREAD, &len); 1224 if (rc != -1 && signalled == 0) 1225 { 1226 signalled = 1; 1227 LogRel(("NAT: fetching number of bits has been failed for ICMP socket \n")); 1228 } 1229 len = (len != 0 && rc != -1 ? len : 1500); 1230 buff = RTMemAlloc(len); 1231 len = recvfrom(so->s, buff, len, 0, 1215 1232 (struct sockaddr *)&addr, &addrlen); 1216 1233 /* XXX Check if reply is "correct"? */ … … 1234 1251 send_icmp_to_guest(pData, buff, len, so, &addr); 1235 1252 } 1253 RTMemFree(buff); 1236 1254 } 1237 1255 #endif /* !RT_OS_WINDOWS */
Note:
See TracChangeset
for help on using the changeset viewer.