Changeset 104603 in vbox
- Timestamp:
- May 13, 2024 3:19:03 PM (7 months ago)
- Location:
- trunk/src/VBox/NetworkServices/NAT
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp
r98103 r104603 257 257 VBoxNetLwipNAT::VBoxNetLwipNAT() 258 258 : m_uVerbosity(0), 259 m_hThrRecv(NIL_RTTHREAD) 259 m_hIf(NULL), 260 m_hThrRecv(NIL_RTTHREAD), 261 m_u16Mtu(1500) 260 262 { 261 263 LogFlowFuncEnter(); … … 356 358 { 357 359 unsigned int uVerbosity = 0; 358 int rc;359 360 360 361 RTGETOPTSTATE State; 361 rc = RTGetOptInit(&State, argc, argv, 362 s_aGetOptDef, RT_ELEMENTS(s_aGetOptDef), 363 1, 0); 362 int rc = RTGetOptInit(&State, argc, argv, 363 s_aGetOptDef, RT_ELEMENTS(s_aGetOptDef), 364 1, 0); 365 if (RT_FAILURE(rc)) 366 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc", rc); 364 367 365 368 int ch; … … 1347 1350 VBoxNetLwipNAT::run() 1348 1351 { 1349 int rc;1350 1351 1352 AssertReturn(m_hThrRecv == NIL_RTTHREAD, VERR_INVALID_STATE); 1352 1353 … … 1355 1356 1356 1357 /* spawn intnet input pump */ 1357 rc = RTThreadCreate(&m_hThrRecv,1358 VBoxNetLwipNAT::receiveThread, this,1359 0, /* :cbStack */1360 RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE,1361 "RECV");1358 int rc = RTThreadCreate(&m_hThrRecv, 1359 VBoxNetLwipNAT::receiveThread, this, 1360 0, /* :cbStack */ 1361 RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, 1362 "RECV"); 1362 1363 AssertRCReturn(rc, rc); 1363 1364 … … 1400 1401 m_hThrRecv = NIL_RTTHREAD; 1401 1402 1402 return VINF_SUCCESS;1403 return rc; 1403 1404 } 1404 1405 … … 2083 2084 message.appendPrintf("%s" "callee %ls", 2084 2085 pcszSeparator, info.getCalleeName().raw()); 2085 pcszSeparator = pcszComma;2086 //pcszSeparator = pcszComma; unused 2086 2087 } 2087 2088 -
trunk/src/VBox/NetworkServices/NAT/proxy.c
r98103 r104603 468 468 struct sockaddr *pdst_sa; 469 469 socklen_t dst_sa_len; 470 void *pdst_addr;471 470 const struct sockaddr *psrc_sa; 472 471 socklen_t src_sa_len; … … 481 480 if (sdom == PF_INET6) { 482 481 pdst_sa = (struct sockaddr *)&dst_sin6; 483 pdst_addr = (void *)&dst_sin6.sin6_addr;484 482 485 483 memset(&dst_sin6, 0, sizeof(dst_sin6)); … … 496 494 else { /* sdom = PF_INET */ 497 495 pdst_sa = (struct sockaddr *)&dst_sin; 498 pdst_addr = (void *)&dst_sin.sin_addr;499 496 500 497 memset(&dst_sin, 0, sizeof(dst_sin)); -
trunk/src/VBox/NetworkServices/NAT/proxy_dhcp6ds.c
r98103 r104603 177 177 { 178 178 u8_t msg_header[4]; 179 unsigned int msg_type , msg_tid;179 unsigned int msg_type; 180 180 int copied; 181 181 size_t roff; … … 195 195 196 196 msg_type = msg_header[0]; 197 msg_tid = (msg_header[1] << 16) | (msg_header[2] << 8) | msg_header[3];198 DPRINTF(("%s: type %u, tid 0x%6x\n", __func__, msg_type, msg_tid));197 DPRINTF(("%s: type %u, tid 0x%6x\n", __func__, msg_type, 198 (uint32_t)((msg_header[1] << 16) | (msg_header[2] << 8) | msg_header[3]))); 199 199 if (msg_type != DHCP6_INFORMATION_REQUEST) { /** @todo ? RELAY_FORW */ 200 200 pbuf_free(p); -
trunk/src/VBox/NetworkServices/NAT/proxy_pollmgr.c
r98103 r104603 259 259 SOCKET fd; 260 260 ssize_t nsent; 261 int rc;262 261 263 262 AssertReturn(0 <= slot && slot < POLLMGR_CHAN_COUNT, -1); … … 276 275 ptr = *(void **)buf; 277 276 278 rc = RTReqQueueCallEx(pollmgr.queue, NULL, 0, 279 RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT, 280 (PFNRT)pollmgr_chan_call_handler, 2, 281 slot, ptr); 277 int rc = RTReqQueueCallEx(pollmgr.queue, NULL, 0, 278 RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT, 279 (PFNRT)pollmgr_chan_call_handler, 2, 280 slot, ptr); 281 if (RT_FAILURE(rc)) 282 { 283 DPRINTF(("Queuing pollmgr_chan_call_handler() on poll manager queue failed with %Rrc\n", rc)); 284 return -1; 285 } 282 286 283 287 fd = pollmgr.chan[POLLMGR_QUEUE][POLLMGR_CHFD_WR]; … … 304 308 pollmgr_queue_callback(struct pollmgr_handler *handler, SOCKET fd, int revents) 305 309 { 306 ssize_t nread;307 int sockerr;308 int rc;309 310 310 RT_NOREF(handler, revents); 311 311 Assert(pollmgr.queue != NIL_RTREQQUEUE); 312 312 313 nread = recv(fd, (char *)pollmgr_udpbuf, sizeof(pollmgr_udpbuf), 0); 314 sockerr = SOCKERRNO(); /* save now, may be clobbered */ 315 313 ssize_t nread = recv(fd, (char *)pollmgr_udpbuf, sizeof(pollmgr_udpbuf), 0); 316 314 if (nread == SOCKET_ERROR) { 317 DPRINTF0(("%s: recv: %R[sockerr]\n", __func__, sockerr));315 DPRINTF0(("%s: recv: %R[sockerr]\n", __func__, SOCKERRNO())); 318 316 return POLLIN; 319 317 } … … 324 322 } 325 323 326 rc = RTReqQueueProcess(pollmgr.queue, 0);324 int rc = RTReqQueueProcess(pollmgr.queue, 0); 327 325 if (RT_UNLIKELY(rc != VERR_TIMEOUT && RT_FAILURE_NP(rc))) { 328 326 DPRINTF0(("%s: RTReqQueueProcess: %Rrc\n", __func__, rc)); -
trunk/src/VBox/NetworkServices/NAT/pxping.c
r98103 r104603 686 686 int hopl; 687 687 u16_t iphlen; 688 u16_t id , seq;688 u16_t id; 689 689 int status; 690 690 … … 695 695 696 696 id = icmph->id; 697 seq = icmph->seqno;698 699 697 pcb = pxping_pcb_for_request(pxping, 1, 700 698 ipX_current_src_addr(), … … 708 706 DPRINTF(("ping %p: %R[ping_pcb] seq %d len %u hopl %d\n", 709 707 pcb, pcb, 710 ntohs( seq), (unsigned int)p->tot_len,708 ntohs(icmph->seqno), (unsigned int)p->tot_len, 711 709 IP6H_HOPLIM(iph))); 712 710 … … 1259 1257 struct ip_hdr *iph; 1260 1258 struct icmp_echo_hdr *icmph; 1261 u16_t id , seq;1259 u16_t id; 1262 1260 ip_addr_t guest_ip, target_ip; 1263 1261 int mapped; … … 1272 1270 1273 1271 id = icmph->id; 1274 seq = icmph->seqno;1275 1276 1272 DPRINTF(("<--- PING %RTnaipv4 id 0x%x seq %d\n", 1277 peer->sin_addr.s_addr, ntohs(id), ntohs( seq)));1273 peer->sin_addr.s_addr, ntohs(id), ntohs(icmph->seqno))); 1278 1274 1279 1275 /* … … 1362 1358 struct icmp_echo_hdr *icmph, *oicmph; 1363 1359 u16_t oipoff, oiphlen, oiplen; 1364 u16_t id , seq;1360 u16_t id; 1365 1361 ip_addr_t guest_ip, target_ip, error_ip; 1366 1362 int target_mapped, error_mapped; … … 1424 1420 1425 1421 id = oicmph->id; 1426 seq = oicmph->seqno;1427 1422 1428 1423 DPRINTF2(("%s: ping %RTnaipv4 id 0x%x seq %d", 1429 __func__, ip4_addr_get_u32(&oiph->dest), ntohs(id), ntohs( seq)));1424 __func__, ip4_addr_get_u32(&oiph->dest), ntohs(id), ntohs(oicmph->seqno))); 1430 1425 if (ICMPH_TYPE(icmph) == ICMP_DUR) { 1431 1426 DPRINTF2((" unreachable (code %d)\n", ICMPH_CODE(icmph))); -
trunk/src/VBox/NetworkServices/NAT/pxtcp.c
r98103 r104603 1748 1748 nread = pxtcp_sock_read(pxtcp, &stop_pollin); 1749 1749 if (nread < 0) { 1750 sockerr = -(int)nread; 1751 DPRINTF0(("sock %d: POLLIN: %R[sockerr]\n", fd, sockerr)); 1750 DPRINTF0(("sock %d: POLLIN: %R[sockerr]\n", fd, -(int)nread)); 1752 1751 return pxtcp_schedule_reset(pxtcp); 1753 1752 }
Note:
See TracChangeset
for help on using the changeset viewer.