Changeset 51597 in vbox for trunk/src/VBox
- Timestamp:
- Jun 10, 2014 6:35:32 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94321
- Location:
- trunk/src/VBox/NetworkServices/NAT
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/NAT/fwtcp.c
r51576 r51597 144 144 lsock = proxy_bound_socket(fwspec->sdom, fwspec->stype, &fwspec->src.sa); 145 145 if (lsock == INVALID_SOCKET) { 146 perror("socket");147 146 return NULL; 148 147 } -
trunk/src/VBox/NetworkServices/NAT/fwudp.c
r51574 r51597 171 171 sock = proxy_bound_socket(fwspec->sdom, fwspec->stype, &fwspec->src.sa); 172 172 if (sock == INVALID_SOCKET) { 173 perror("socket");174 173 return NULL; 175 174 } … … 267 266 (struct sockaddr *)&ss, &sslen); 268 267 if (nread < 0) { 269 perror(__func__);268 DPRINTF(("%s: %R[sockerr]\n", __func__, SOCKERRNO())); 270 269 return POLLIN; 271 270 } -
trunk/src/VBox/NetworkServices/NAT/proxy.c
r51594 r51597 298 298 s = socket(sdom, stype_and_flags, 0); 299 299 if (s == INVALID_SOCKET) { 300 perror("socket");300 DPRINTF(("socket: %R[sockerr]\n", SOCKERRNO())); 301 301 return INVALID_SOCKET; 302 302 } … … 308 308 sflags = fcntl(s, F_GETFL, 0); 309 309 if (sflags < 0) { 310 perror("F_GETFL");310 DPRINTF(("F_GETFL: %R[sockerr]\n", SOCKERRNO())); 311 311 closesocket(s); 312 312 return INVALID_SOCKET; … … 315 315 status = fcntl(s, F_SETFL, sflags | O_NONBLOCK); 316 316 if (status < 0) { 317 perror("O_NONBLOCK");317 DPRINTF(("O_NONBLOCK: %R[sockerr]\n", SOCKERRNO())); 318 318 closesocket(s); 319 319 return INVALID_SOCKET; … … 329 329 status = setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, &on, onlen); 330 330 if (status < 0) { 331 perror("SO_NOSIGPIPE");331 DPRINTF(("SO_NOSIGPIPE: %R[sockerr]\n", SOCKERRNO())); 332 332 closesocket(s); 333 333 return INVALID_SOCKET; … … 341 341 status = ioctlsocket(s, FIONBIO, &mode); 342 342 if (status == SOCKET_ERROR) { 343 warn("ioctl error: %d\n", WSAGetLastError());343 DPRINTF(("FIONBIO: %R[sockerr]\n", SOCKERRNO())); 344 344 closesocket(s); 345 345 return INVALID_SOCKET; … … 471 471 status = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&on, onlen); 472 472 if (status < 0) { /* not good, but not fatal */ 473 warn("SO_REUSEADDR");473 DPRINTF(("SO_REUSEADDR: %R[sockerr]\n", SOCKERRNO())); 474 474 } 475 475 … … 479 479 : sizeof(struct sockaddr_in6)); 480 480 if (status < 0) { 481 perror("bind");481 DPRINTF(("bind: %R[sockerr]\n", SOCKERRNO())); 482 482 closesocket(s); 483 483 return INVALID_SOCKET; … … 487 487 status = listen(s, 5); 488 488 if (status < 0) { 489 perror("listen");489 DPRINTF(("listen: %R[sockerr]\n", SOCKERRNO())); 490 490 closesocket(s); 491 491 return INVALID_SOCKET; -
trunk/src/VBox/NetworkServices/NAT/proxy_pollmgr.c
r51574 r51597 83 83 status = socketpair(PF_LOCAL, SOCK_DGRAM, 0, pollmgr.chan[i]); 84 84 if (status < 0) { 85 perror("socketpair");85 DPRINTF(("socketpair: %R[sockerr]\n", SOCKERRNO())); 86 86 goto cleanup_close; 87 87 } 88 88 #else 89 89 status = RTWinSocketPair(PF_INET, SOCK_DGRAM, 0, pollmgr.chan[i]); 90 AssertRCReturn(status, -1);91 92 90 if (RT_FAILURE(status)) { 93 perror("socketpair");94 91 goto cleanup_close; 95 92 } … … 104 101 malloc(newcap * sizeof(*pollmgr.fds)); 105 102 if (newfds == NULL) { 106 perror("calloc");103 DPRINTF(("%s: Failed to allocate fds array\n", __func__)); 107 104 goto cleanup_close; 108 105 } … … 111 108 malloc(newcap * sizeof(*pollmgr.handlers)); 112 109 if (newhdls == NULL) { 113 perror("malloc");110 DPRINTF(("%s: Failed to allocate handlers array\n", __func__)); 114 111 free(newfds); 115 112 goto cleanup_close; … … 180 177 realloc(pollmgr.fds, newcap * sizeof(*pollmgr.fds)); 181 178 if (newfds == NULL) { 182 perror("realloc");179 DPRINTF(("%s: Failed to reallocate fds array\n", __func__)); 183 180 handler->slot = -1; 184 181 return -1; … … 191 188 realloc(pollmgr.handlers, newcap * sizeof(*pollmgr.handlers)); 192 189 if (newhdls == NULL) { 193 perror("realloc");190 DPRINTF(("%s: Failed to reallocate handlers array\n", __func__)); 194 191 /* if we failed to realloc here, then fds points to the 195 192 * new array, but we pretend we still has old capacity */ … … 242 239 nsent = send(fd, buf, (int)nbytes, 0); 243 240 if (nsent == SOCKET_ERROR) { 244 warn("send on chan %d", slot);241 DPRINTF(("send on chan %d: %R[sockerr]\n", slot, SOCKERRNO())); 245 242 return -1; 246 243 } 247 244 else if ((size_t)nsent != nbytes) { 248 warnx("send on chan %d: datagram truncated to %u bytes",249 slot, (unsigned int)nsent);245 DPRINTF(("send on chan %d: datagram truncated to %u bytes", 246 slot, (unsigned int)nsent)); 250 247 return -1; 251 248 } -
trunk/src/VBox/NetworkServices/NAT/pxdns.c
r51581 r51597 798 798 nread = recv(fd, pollmgr_udpbuf, sizeof(pollmgr_udpbuf), 0); 799 799 if (nread < 0) { 800 perror(__func__);800 DPRINTF(("%s: %R[sockerr]\n", __func__, SOCKERRNO())); 801 801 return POLLIN; 802 802 } -
trunk/src/VBox/NetworkServices/NAT/pxping.c
r51581 r51597 272 272 &dont, sizeof(dont)); 273 273 if (status != 0) { 274 perror("IP_MTU_DISCOVER");274 DPRINTF(("IP_MTU_DISCOVER: %R[sockerr]\n", SOCKERRNO())); 275 275 } 276 276 } … … 305 305 (const char *)&on, sizeof(on)); 306 306 if (status < 0) { 307 perror("IPV6_RECVPKTINFO");307 DPRINTF(("IPV6_RECVPKTINFO: %R[sockerr]\n", SOCKERRNO())); 308 308 /* XXX: for now this is fatal */ 309 309 } … … 315 315 (const char *)&on, sizeof(on)); 316 316 if (status < 0) { 317 perror("IPV6_RECVHOPLIMIT");317 DPRINTF(("IPV6_RECVHOPLIMIT: %R[sockerr]\n", SOCKERRNO())); 318 318 } 319 319 … … 495 495 } 496 496 else { 497 perror("IP_HDRINCL");497 DPRINTF(("IP_HDRINCL: %R[sockerr]\n", SOCKERRNO())); 498 498 } 499 499 } … … 554 554 } 555 555 else { 556 perror(dfoptname);556 DPRINTF(("%s: %R[sockerr]\n", dfoptname, SOCKERRNO())); 557 557 } 558 558 } … … 566 566 } 567 567 else { 568 perror("IP_TTL");568 DPRINTF(("IP_TTL: %R[sockerr]\n", SOCKERRNO())); 569 569 } 570 570 } … … 578 578 } 579 579 else { 580 perror("IP_TOS");580 DPRINTF(("IP_TOS: %R[sockerr]\n", SOCKERRNO())); 581 581 } 582 582 } … … 711 711 } 712 712 else { 713 perror("IPV6_HOPLIMIT");713 DPRINTF(("IPV6_HOPLIMIT: %R[sockerr]\n", SOCKERRNO())); 714 714 } 715 715 } … … 1123 1123 (struct sockaddr *)&sin, &salen); 1124 1124 if (nread < 0) { 1125 perror(__func__);1125 DPRINTF(("%s: %R[sockerr]\n", __func__, SOCKERRNO())); 1126 1126 return; 1127 1127 } … … 1484 1484 nread = recvmsg(pxping->sock6, &mh, 0); 1485 1485 if (nread < 0) { 1486 perror(__func__);1486 DPRINTF(("%s: %R[sockerr]\n", __func__, SOCKERRNO())); 1487 1487 return; 1488 1488 } -
trunk/src/VBox/NetworkServices/NAT/pxudp.c
r51581 r51597 579 579 nread = recv(pxudp->sock, pollmgr_udpbuf, sizeof(pollmgr_udpbuf), 0); 580 580 if (nread == SOCKET_ERROR) { 581 perror(__func__);581 DPRINTF(("%s: %R[sockerr]\n", __func__, SOCKERRNO())); 582 582 return POLLIN; 583 583 } -
trunk/src/VBox/NetworkServices/NAT/winutils.h
r51585 r51597 22 22 # endif 23 23 24 # define warn(...) DPRINTF2((__VA_ARGS__))25 # define warnx warn26 24 # ifdef DEBUG 27 25 # define err(code,...) do { \
Note:
See TracChangeset
for help on using the changeset viewer.