- Timestamp:
- Oct 27, 2021 8:18:16 AM (3 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r91897 r92093 1599 1599 "|ICMPCacheLimit" 1600 1600 "|SoMaxConnection" 1601 "|LocalhostReachable" 1601 1602 //#ifdef VBOX_WITH_DNSMAPPING_IN_HOSTRESOLVER 1602 1603 "|HostResolverMappings" … … 1626 1627 int iIcmpCacheLimit = 100; 1627 1628 GET_S32(rc, pDrvIns, pCfg, "ICMPCacheLimit", iIcmpCacheLimit); 1629 bool fLocalhostReachable = false; 1630 GET_BOOL(rc, pDrvIns, pCfg, "LocalhostReachable", fLocalhostReachable); 1628 1631 1629 1632 i32AliasMode |= (i32MainAliasMode & 0x1 ? 0x1 : 0); … … 1666 1669 rc = slirp_init(&pThis->pNATState, RT_H2N_U32(Network.u), Netmask.u, 1667 1670 fPassDomain, !!fUseHostResolver, i32AliasMode, 1668 iIcmpCacheLimit, pThis);1671 iIcmpCacheLimit, fLocalhostReachable, pThis); 1669 1672 if (RT_SUCCESS(rc)) 1670 1673 { -
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r85082 r92093 481 481 || CTL_CHECK(dst, CTL_TFTP)) 482 482 { 483 /* Don't reply to ping requests for the hosts loopback interface if it is disabled. */ 484 if ( CTL_CHECK(dst, CTL_ALIAS) 485 && !pData->fLocalhostReachable) 486 goto done; 487 483 488 uint8_t echo_reply = ICMP_ECHOREPLY; 484 489 m_copyback(pData, m, hlen + RT_OFFSETOF(struct icmp, icmp_type), -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r82968 r92093 47 47 #endif 48 48 49 int slirp_init(PNATState *, uint32_t, uint32_t, bool, bool, int, int, void *);49 int slirp_init(PNATState *, uint32_t, uint32_t, bool, bool, int, int, bool, void *); 50 50 void slirp_register_statistics(PNATState pData, PPDMDRVINS pDrvIns); 51 51 void slirp_deregister_statistics(PNATState pData, PPDMDRVINS pDrvIns); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r87126 r92093 299 299 int slirp_init(PNATState *ppData, uint32_t u32NetAddr, uint32_t u32Netmask, 300 300 bool fPassDomain, bool fUseHostResolver, int i32AliasMode, 301 int iIcmpCacheLimit, void *pvUser)301 int iIcmpCacheLimit, bool fLocalhostReachable, void *pvUser) 302 302 { 303 303 int rc; … … 316 316 pData->fUseHostResolver = fUseHostResolver; 317 317 pData->fUseHostResolverPermanent = fUseHostResolver; 318 pData->fLocalhostReachable = fLocalhostReachable; 318 319 pData->pvUser = pvUser; 319 320 pData->netmask = u32Netmask; … … 1353 1354 || CTL_CHECK(ip4TargetAddress, CTL_TFTP)) 1354 1355 { 1356 #if 0 /* Dropping ARP requests destined for CTL_ALIAS breaks all outgoing traffic completely, so don't do that... */ 1357 /* Don't reply to ARP requests for the hosts loopback interface if it is disabled. */ 1358 if ( CTL_CHECK(ip4TargetAddress, CTL_ALIAS) 1359 && !pData->fLocalhostReachable) 1360 break; 1361 #endif 1355 1362 slirp_update_guest_addr_guess(pData, *(uint32_t *)pARPHeader->ar_sip, "arp request"); 1356 1363 arp_output(pData, pEtherHeader->h_source, pARPHeader, ip4TargetAddress); -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r82968 r92093 287 287 /* this field control behaviour of DHCP server */ 288 288 bool fUseDnsProxy; 289 /** Flag whether the guest can contact services on the host's 290 * loopback interface (127.0.0.1/localhost). */ 291 bool fLocalhostReachable; 289 292 290 293 LIST_HEAD(RT_NOTHING, libalias) instancehead; -
trunk/src/VBox/Devices/Network/slirp/tcp_input.c
r86843 r92093 502 502 } 503 503 LogFlowFunc(("(leave) findso: %R[natsock]\n", so)); 504 505 /* 506 * Check whether the packet is targeting CTL_ALIAS and drop it if the connection wasn't 507 * initiated by localhost (so == NULL), see @bugref{9896}. 508 */ 509 if ( (RT_N2H_U32(ti->ti_dst.s_addr) & ~pData->netmask) == CTL_ALIAS 510 && !pData->fLocalhostReachable 511 && !so) 512 { 513 LogFlowFunc(("Packet for CTL_ALIAS and fLocalhostReachable=false so=NULL -> drop\n")); 514 goto drop; 515 } 504 516 505 517 /* -
trunk/src/VBox/Devices/Network/slirp/udp.c
r82968 r92093 233 233 234 234 /* 235 * Drop UDP packets destind for CTL_ALIAS (i.e. the hosts loopback interface) 236 * if it is disabled. 237 */ 238 if ( CTL_CHECK(ip->ip_dst.s_addr, CTL_ALIAS) 239 && !pData->fLocalhostReachable) 240 goto done_free_mbuf; 241 242 /* 235 243 * Locate pcb for datagram. 236 244 */
Note:
See TracChangeset
for help on using the changeset viewer.