]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
NetworkPkg/UefiPxeBcDxe: Correct the handle for PXE Base Code Callback Protocol.
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcSupport.c
index 3ea95185745291594ba1cb7f297ecd1ceb471ff4..9f5be15ce6bb7df1586045bcf147fc1b3de30df6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support functions implementation for UefiPxeBc Driver.\r
 \r
-  Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -258,7 +258,9 @@ PxeBcIcmpErrorDpcHandle (
   }\r
 \r
   if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&\r
-      !NetIp4IsUnicast (EFI_NTOHL (RxData->Header->SourceAddress), 0)) {\r
+      (NTOHL (Mode->SubnetMask.Addr[0]) != 0) &&\r
+      IP4_NET_EQUAL (NTOHL(Mode->StationIp.Addr[0]), EFI_NTOHL (RxData->Header->SourceAddress), NTOHL (Mode->SubnetMask.Addr[0])) &&\r
+      !NetIp4IsUnicast (EFI_NTOHL (RxData->Header->SourceAddress), NTOHL (Mode->SubnetMask.Addr[0]))) {\r
     //\r
     // The source address of the received packet should be a valid unicast address.\r
     //\r
@@ -422,7 +424,7 @@ PxeBcIcmp6ErrorDpcHandle (
 \r
   if (Type != ICMP_V6_DEST_UNREACHABLE &&\r
       Type != ICMP_V6_PACKET_TOO_BIG &&\r
-      Type != ICMP_V6_PACKET_TOO_BIG &&\r
+      Type != ICMP_V6_TIME_EXCEEDED &&\r
       Type != ICMP_V6_PARAMETER_PROBLEM) {\r
     //\r
     // The type of the receveid packet should be an ICMP6 error message.\r
@@ -1381,11 +1383,10 @@ PxeBcUintnToAscDecWithFormat (
 {\r
   UINTN                          Remainder;\r
 \r
-  while (Length > 0) {\r
-    Length--;\r
+  for (; Length > 0; Length--) {\r
     Remainder      = Number % 10;\r
     Number        /= 10;\r
-    Buffer[Length] = (UINT8) ('0' + Remainder);\r
+    Buffer[Length - 1] = (UINT8) ('0' + Remainder);\r
   }\r
 }\r
 \r