Changeset 36352 in vbox
- Timestamp:
- Mar 23, 2011 4:58:16 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r36216 r36352 1456 1456 * let's do an ARP cache update 1457 1457 */ 1458 slirp_arp_cache_update_or_add(pData, *(uint32_t *)ah->ar_tip, &eh->h_dest[0]); 1458 static bool fGratuitousArpReported; 1459 if (!fGratuitousArpReported) 1460 { 1461 LogRel(("NAT: Gratuitous ARP [IP:%R[IP4], ether:%R[ether]]\n", 1462 ah->ar_sip, ah->ar_sha)); 1463 fGratuitousArpReported = true; 1464 } 1465 slirp_arp_cache_update_or_add(pData, *(uint32_t *)ah->ar_sip, &ah->ar_sha[0]); 1459 1466 } 1460 1467 break; … … 1948 1955 LIST_FOREACH(ac, &pData->arp_cache, list) 1949 1956 { 1950 if (ac->ip == ip) 1957 if ( ac->ip == ip 1958 && memcmp(ac->ether, broadcast_ethaddr, ETH_ALEN) != 0) 1951 1959 { 1952 1960 memcpy(ether, ac->ether, ETH_ALEN); … … 2027 2035 { 2028 2036 struct arp_cache_entry *ac; 2037 if (!memcmp(mac, broadcast_ethaddr, ETH_ALEN)) 2038 return 1; 2029 2039 LIST_FOREACH(ac, &pData->arp_cache, list) 2030 2040 { 2031 if ( memcmp(ac->ether, mac, ETH_ALEN) == 0)2041 if (!memcmp(ac->ether, mac, ETH_ALEN)) 2032 2042 { 2033 2043 ac->ip = dst; … … 2048 2058 } 2049 2059 ac->ip = ip; 2060 if(!memcmp(ether, broadcast_ethaddr, ETH_ALEN)) 2061 { 2062 static bool fBroadcastEtherAddReported; 2063 if (!fBroadcastEtherAddReported) 2064 { 2065 LogRel(("NAT: Attept to add pair [%R[ether]:%R[IP4]] was ignored\n", 2066 ether, ip)); 2067 fBroadcastEtherAddReported = true; 2068 } 2069 RTMemFree(ac); 2070 return; 2071 } 2050 2072 memcpy(ac->ether, ether, ETH_ALEN); 2051 2073 LIST_INSERT_HEAD(&pData->arp_cache, ac, list);
Note:
See TracChangeset
for help on using the changeset viewer.