Interface routine for Mtftp4.\r
\r
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, 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
return Status;\r
}\r
\r
+ if ((Token->OverrideData != NULL) && !Mtftp4OverrideValid (Instance, Token->OverrideData)) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ gBS->RestoreTPL (OldTpl);\r
+ return Status;\r
+ }\r
+\r
//\r
// Set the Operation now to prevent the application start other\r
// operations.\r
Instance->Operation = Operation;\r
Override = Token->OverrideData;\r
\r
- if ((Override != NULL) && !Mtftp4OverrideValid (Instance, Override)) {\r
- Status = EFI_INVALID_PARAMETER;\r
- goto ON_ERROR;\r
- }\r
-\r
if (Token->OptionCount != 0) {\r
Status = Mtftp4ParseOption (\r
Token->OptionList,\r
);\r
\r
if (EFI_ERROR (Status)) {\r
+ Status = EFI_DEVICE_ERROR;\r
goto ON_ERROR;\r
}\r
}\r
Status = Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance);\r
\r
if (EFI_ERROR (Status)) {\r
+ Status = EFI_DEVICE_ERROR;\r
goto ON_ERROR;\r
}\r
\r
Status = Mtftp4RrqStart (Instance, Operation);\r
}\r
\r
- gBS->RestoreTPL (OldTpl);\r
-\r
if (EFI_ERROR (Status)) {\r
+ Status = EFI_DEVICE_ERROR;\r
goto ON_ERROR;\r
}\r
\r
if (Token->Event != NULL) {\r
+ gBS->RestoreTPL (OldTpl);\r
return EFI_SUCCESS;\r
}\r
\r
This->Poll (This);\r
}\r
\r
+ gBS->RestoreTPL (OldTpl);\r
return Token->Status;\r
\r
ON_ERROR:\r
Gateway = NTOHL (Gateway);\r
ServerIp = NTOHL (ServerIp);\r
\r
+ if (ServerIp == 0 || IP4_IS_LOCAL_BROADCAST (ServerIp)) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
if (!ConfigData->UseDefaultSetting &&\r
((!IP4_IS_VALID_NETMASK (Netmask) || (Netmask != 0 && !NetIp4IsUnicast (Ip, Netmask))))) {\r
\r