Changeset 99404 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/ArpDxe/ArpMain.c
- Timestamp:
- Apr 14, 2023 3:17:44 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156854
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-145445 /vendor/edk2/current 103735-103757,103769-103776,129194-156846
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/ArpDxe/ArpMain.c
r85718 r99404 8 8 9 9 #include "ArpImpl.h" 10 11 10 12 11 /** … … 54 53 55 54 if ((ConfigData != NULL) && 56 ((ConfigData->SwAddressLength == 0) || 57 (ConfigData->StationAddress == NULL) || 58 (ConfigData->SwAddressType <= 1500))) { 55 ((ConfigData->SwAddressLength == 0) || 56 (ConfigData->StationAddress == NULL) || 57 (ConfigData->SwAddressType <= 1500))) 58 { 59 59 return EFI_INVALID_PARAMETER; 60 60 } … … 73 73 return Status; 74 74 } 75 76 75 77 76 /** … … 144 143 145 144 if (((!DenyFlag) && ((TargetHwAddress == NULL) || (TargetSwAddress == NULL))) || 146 (DenyFlag && (TargetHwAddress != NULL) && (TargetSwAddress != NULL)) || 147 ((TargetHwAddress == NULL) && (TargetSwAddress == NULL))) { 145 (DenyFlag && (TargetHwAddress != NULL) && (TargetSwAddress != NULL)) || 146 ((TargetHwAddress == NULL) && (TargetSwAddress == NULL))) 147 { 148 148 return EFI_INVALID_PARAMETER; 149 149 } … … 163 163 // 164 164 MatchAddress[Hardware].Type = SnpMode->IfType; 165 MatchAddress[Hardware].Length = (UINT8) 165 MatchAddress[Hardware].Length = (UINT8)SnpMode->HwAddressSize; 166 166 MatchAddress[Hardware].AddressPtr = TargetHwAddress; 167 167 … … 230 230 231 231 if (CacheEntry == NULL) { 232 DEBUG (( EFI_D_ERROR, "ArpAdd: Failed to allocate pool for CacheEntry.\n"));232 DEBUG ((DEBUG_ERROR, "ArpAdd: Failed to allocate pool for CacheEntry.\n")); 233 233 Status = EFI_OUT_OF_RESOURCES; 234 234 goto UNLOCK_EXIT; … … 271 271 return Status; 272 272 } 273 274 273 275 274 /** … … 324 323 325 324 if ((This == NULL) || 326 (!Refresh && (EntryCount == NULL) && (EntryLength == NULL)) || 327 ((Entries != NULL) && ((EntryLength == NULL) || (EntryCount == NULL)))) { 328 return EFI_INVALID_PARAMETER; 329 } 330 331 Instance = ARP_INSTANCE_DATA_FROM_THIS (This); 325 (!Refresh && (EntryCount == NULL) && (EntryLength == NULL)) || 326 ((Entries != NULL) && ((EntryLength == NULL) || (EntryCount == NULL)))) 327 { 328 return EFI_INVALID_PARAMETER; 329 } 330 331 Instance = ARP_INSTANCE_DATA_FROM_THIS (This); 332 332 333 333 if (!Instance->Configured) { … … 354 354 return Status; 355 355 } 356 357 356 358 357 /** … … 407 406 } 408 407 409 410 408 /** 411 409 This function delete all dynamic entries from the ARP cache that match the specified … … 451 449 return (Count == 0) ? EFI_NOT_FOUND : EFI_SUCCESS; 452 450 } 453 454 451 455 452 /** … … 509 506 510 507 if ((TargetSwAddress == NULL) || 511 ((Instance->ConfigData.SwAddressType == IPV4_ETHER_PROTO_TYPE) && 512 IP4_IS_LOCAL_BROADCAST (*((UINT32 *)TargetSwAddress)))) { 508 ((Instance->ConfigData.SwAddressType == IPV4_ETHER_PROTO_TYPE) && 509 IP4_IS_LOCAL_BROADCAST (*((UINT32 *)TargetSwAddress)))) 510 { 513 511 // 514 512 // Return the hardware broadcast address. … … 520 518 521 519 if ((Instance->ConfigData.SwAddressType == IPV4_ETHER_PROTO_TYPE) && 522 IP4_IS_MULTICAST (NTOHL (*((UINT32 *)TargetSwAddress)))) { 520 IP4_IS_MULTICAST (NTOHL (*((UINT32 *)TargetSwAddress)))) 521 { 523 522 // 524 523 // If the software address is an IPv4 multicast address, invoke Mnp to … … 589 588 // Create a request context for this arp request. 590 589 // 591 RequestContext = AllocatePool (sizeof (USER_REQUEST_CONTEXT));590 RequestContext = AllocatePool (sizeof (USER_REQUEST_CONTEXT)); 592 591 if (RequestContext == NULL) { 593 DEBUG (( EFI_D_ERROR, "ArpRequest: Allocate memory for RequestContext failed.\n"));592 DEBUG ((DEBUG_ERROR, "ArpRequest: Allocate memory for RequestContext failed.\n")); 594 593 595 594 Status = EFI_OUT_OF_RESOURCES; … … 613 612 ); 614 613 if (CacheEntry != NULL) { 615 616 614 CacheEntry->NextRetryTime = Instance->ConfigData.RetryTimeOut; 617 615 CacheEntry->RetryCount = Instance->ConfigData.RetryCount; … … 622 620 CacheEntry = ArpAllocCacheEntry (Instance); 623 621 if (CacheEntry == NULL) { 624 DEBUG (( EFI_D_ERROR, "ArpRequest: Allocate memory for CacheEntry failed.\n"));622 DEBUG ((DEBUG_ERROR, "ArpRequest: Allocate memory for CacheEntry failed.\n")); 625 623 FreePool (RequestContext); 626 624 … … 668 666 return Status; 669 667 } 670 671 668 672 669 /** … … 710 707 711 708 if ((This == NULL) || 712 ((TargetSwAddress != NULL) && (ResolvedEvent == NULL)) || 713 ((TargetSwAddress == NULL) && (ResolvedEvent != NULL))) { 709 ((TargetSwAddress != NULL) && (ResolvedEvent == NULL)) || 710 ((TargetSwAddress == NULL) && (ResolvedEvent != NULL))) 711 { 714 712 return EFI_INVALID_PARAMETER; 715 713 }
Note:
See TracChangeset
for help on using the changeset viewer.