]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Dhcp6Dxe/Dhcp6Io.c
ArmPkg/ArmDmaLib: clean up abuse of device address
[mirror_edk2.git] / NetworkPkg / Dhcp6Dxe / Dhcp6Io.c
index 063605e60947bb6a8c7291e27d8c49445cbbda79..5cdeac6d5cfe30bfbe67e1e685323c185361a76e 100644 (file)
@@ -2,7 +2,7 @@
   Dhcp6 internal functions implementation.\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2016, 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
@@ -2827,6 +2827,10 @@ Dhcp6ReceivePacket (
     return ;\r
   }\r
 \r
+  if (Udp6Wrap->TotalSize < sizeof (EFI_DHCP6_HEADER)) {\r
+    goto ON_CONTINUE;\r
+  }\r
+\r
   //\r
   // Copy the net buffer received from upd6 to a Dhcp6 packet.\r
   //\r
@@ -2900,7 +2904,10 @@ ON_CONTINUE:
              0\r
              );\r
     if (EFI_ERROR (Status)) {\r
-      Dhcp6CleanupRetry (Instance, DHCP6_PACKET_ALL);\r
+      NET_LIST_FOR_EACH_SAFE (Entry1, Next1, &Service->Child) {\r
+        Instance = NET_LIST_USER_STRUCT (Entry1, DHCP6_INSTANCE, Link);\r
+        Dhcp6CleanupRetry (Instance, DHCP6_PACKET_ALL);\r
+      }\r
     }\r
   }\r
 \r