]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
MdeModulePkg/IpIoLib: return error instead of ASSERT if input parameter is incorrect.
[mirror_edk2.git] / MdeModulePkg / Library / DxeIpIoLib / DxeIpIoLib.c
index abc07fb0ffa50bd968cb3e0ef20303b533e3e04f..cd9bc3bd543749a5f85b5687efb5958e04a8d951 100644 (file)
@@ -2,7 +2,7 @@
   IpIo Library.\r
 \r
 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1524,10 +1524,12 @@ IpIoDestroy (
   @param[in]       Context               Optional context data.\r
   @param[in]       NotifyData            Optional notify data.\r
   @param[in]       Dest                  The destination IP address to send this packet to.\r
+                                         This parameter is optional when using IPv6.\r
   @param[in]       OverrideData          The data to override some configuration of the IP\r
                                          instance used for sending.\r
 \r
   @retval          EFI_SUCCESS           The operation is completed successfully.\r
+  @retval          EFI_INVALID_PARAMETER The input parameter is not correct.\r
   @retval          EFI_NOT_STARTED       The IpIo is not configured.\r
   @retval          EFI_OUT_OF_RESOURCES  Failed due to resource limit.\r
 \r
@@ -1548,7 +1550,13 @@ IpIoSend (
   IP_IO_IP_PROTOCOL Ip;\r
   IP_IO_SEND_ENTRY  *SndEntry;\r
 \r
-  ASSERT ((IpIo->IpVersion != IP_VERSION_4) || (Dest != NULL));\r
+  if ((IpIo == NULL) || (Pkt == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  if ((IpIo->IpVersion == IP_VERSION_4) && (Dest == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
 \r
   if (!IpIo->IsConfigured) {\r
     return EFI_NOT_STARTED;\r