Changeset 39555 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Dec 8, 2011 5:52:20 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r39498 r39555 1722 1722 { 1723 1723 struct port_forward_rule *rule, *tmp; 1724 const uint8_t *pu8EthSource; 1725 if (!h_source) 1726 pu8EthSource = h_source; 1724 1727 1725 1728 /* check mac here */ … … 1741 1744 1742 1745 #ifdef VBOX_WITH_NAT_SERVICE 1743 if (memcmp(rule->mac_address, h_source, ETH_ALEN) != 0) 1744 continue; /*not right mac, @todo: it'd be better do the list port forwarding per mac */ 1745 guest_addr = find_guest_ip(pData, h_source); 1746 #else 1747 #if 0 1748 if (memcmp(client_ethaddr, h_source, ETH_ALEN) != 0) 1749 continue; 1750 #endif 1751 guest_addr = find_guest_ip(pData, h_source); 1752 #endif 1746 /** 1747 * case when guest ip is INADDR_ANY shouldn't appear in NAT service 1748 */ 1749 Assert((rule->guest_addr.s_addr != INADDR_ANY)); 1750 guest_addr = rule->guest_addr.s_addr; 1751 #else /* VBOX_WITH_NAT_SERVICE */ 1752 guest_addr = find_guest_ip(pData, pu8EthSource); 1753 #endif /* !VBOX_WITH_NAT_SERVICE */ 1753 1754 if (guest_addr == INADDR_ANY) 1754 1755 { … … 1835 1836 { 1836 1837 struct port_forward_rule *rule = NULL; 1837 Assert(ethaddr);1838 1838 LIST_FOREACH(rule, &pData->port_forward_rule_head, list) 1839 1839 { … … 1856 1856 rule->guest_addr.s_addr = guest_addr.s_addr; 1857 1857 rule->bind_ip.s_addr = host_addr.s_addr; 1858 memcpy(rule->mac_address, ethaddr, ETH_ALEN); 1858 if (ethaddr != NULL) 1859 memcpy(rule->mac_address, ethaddr, ETH_ALEN); 1859 1860 /* @todo add mac address */ 1860 1861 LIST_INSERT_HEAD(&pData->port_forward_rule_head, rule, list); 1861 1862 pData->cRedirectionsStored++; 1862 1863 /* activate port-forwarding if guest has already got assigned IP */ 1863 if (memcmp(ethaddr, zerro_ethaddr, ETH_ALEN)) 1864 if ( ethaddr 1865 && memcmp(ethaddr, zerro_ethaddr, ETH_ALEN)) 1864 1866 activate_port_forwarding(pData, ethaddr); 1865 1867 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.