]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
MdeModulePkg BrotliLib: Fix the regression logic issue in loop
[mirror_edk2.git] / MdeModulePkg / Library / DxeIpIoLib / DxeIpIoLib.c
index ab4df80768dc5ef6433da7bf8c35d3d849aca5ac..9a70e9075d9abe43d2b3691bc36b344aadf838b7 100644 (file)
@@ -1029,7 +1029,9 @@ IpIoListenHandlerDpc (
 \r
   if (IpIo->IpVersion == IP_VERSION_4) {\r
     if ((EFI_IP4 (RxData->Ip4RxData.Header->SourceAddress) != 0) &&\r
-        !NetIp4IsUnicast (EFI_NTOHL (((EFI_IP4_RECEIVE_DATA *) RxData)->Header->SourceAddress), 0)) {\r
+        (IpIo->SubnetMask != 0) &&\r
+        IP4_NET_EQUAL (IpIo->StationIp, EFI_NTOHL (((EFI_IP4_RECEIVE_DATA *) RxData)->Header->SourceAddress), IpIo->SubnetMask) &&\r
+        !NetIp4IsUnicast (EFI_NTOHL (((EFI_IP4_RECEIVE_DATA *) RxData)->Header->SourceAddress), IpIo->SubnetMask)) {\r
       //\r
       // The source address is not zero and it's not a unicast IP address, discard it.\r
       //\r
@@ -1300,6 +1302,11 @@ IpIoOpen (
     if (OpenData->IpConfigData.Ip4CfgData.RawData) {\r
       return EFI_UNSUPPORTED;\r
     }\r
+\r
+    if (!OpenData->IpConfigData.Ip4CfgData.UseDefaultAddress) {\r
+      IpIo->StationIp = EFI_NTOHL (OpenData->IpConfigData.Ip4CfgData.StationAddress);\r
+      IpIo->SubnetMask = EFI_NTOHL (OpenData->IpConfigData.Ip4CfgData.SubnetMask);\r
+    }\r
     \r
     Status = IpIo->Ip.Ip4->Configure (\r
                              IpIo->Ip.Ip4,\r
@@ -1439,7 +1446,7 @@ IpIoStop (
   }\r
 \r
   //\r
-  // All pending send tokens should be flushed by reseting the IP instances.\r
+  // All pending send tokens should be flushed by resetting the IP instances.\r
   //\r
   ASSERT (IsListEmpty (&IpIo->PendingSndList));\r
 \r