]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/DnsDxe/DnsProtocol.c
SecurityPkg\SmmTcg2PhysicalPresenceLib.c Handle reserved or unimplemented PP Operation
[mirror_edk2.git] / NetworkPkg / DnsDxe / DnsProtocol.c
index 64fca6a55bf50cc56a2f4a61deb77c37170fa79b..bd189aebbe1c2b02f21417281bebcf6ee8c3c3ca 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Implementation of EFI_DNS4_PROTOCOL and EFI_DNS6_PROTOCOL interfaces.\r
 \r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 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
@@ -246,7 +246,7 @@ Dns4Configure (
     Netmask  = NTOHL (Netmask);\r
 \r
     if (!DnsConfigData->UseDefaultSetting &&\r
-       ((!IP4_IS_VALID_NETMASK (Netmask) || !NetIp4IsUnicast (Ip, Netmask)))) {\r
+        ((!IP4_IS_VALID_NETMASK (Netmask) || (Netmask != 0 && !NetIp4IsUnicast (Ip, Netmask))))) {\r
       Status = EFI_INVALID_PARAMETER;\r
       goto ON_EXIT;\r
     }\r
@@ -287,6 +287,7 @@ Dns4Configure (
     if (EFI_ERROR (Status)) {\r
       if (Instance->Dns4CfgData.DnsServerList != NULL) {\r
         FreePool (Instance->Dns4CfgData.DnsServerList);\r
+        Instance->Dns4CfgData.DnsServerList = NULL;\r
       }\r
       goto ON_EXIT;\r
     }\r
@@ -298,6 +299,7 @@ Dns4Configure (
     if (EFI_ERROR (Status)) {\r
       if (Instance->Dns4CfgData.DnsServerList != NULL) {\r
         FreePool (Instance->Dns4CfgData.DnsServerList);\r
+        Instance->Dns4CfgData.DnsServerList = NULL;\r
       }\r
       goto ON_EXIT;\r
     }\r
@@ -1104,10 +1106,13 @@ Dns6Configure (
     //\r
     // Config UDP\r
     //\r
+    gBS->RestoreTPL (OldTpl);\r
     Status = Dns6ConfigUdp (Instance, Instance->UdpIo);\r
+    OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
     if (EFI_ERROR (Status)) {\r
       if (Instance->Dns6CfgData.DnsServerList != NULL) {\r
         FreePool (Instance->Dns6CfgData.DnsServerList);\r
+        Instance->Dns6CfgData.DnsServerList = NULL;\r
       }\r
       goto ON_EXIT;\r
     }\r
@@ -1119,6 +1124,7 @@ Dns6Configure (
     if (EFI_ERROR (Status)) {\r
       if (Instance->Dns6CfgData.DnsServerList != NULL) {\r
         FreePool (Instance->Dns6CfgData.DnsServerList);\r
+        Instance->Dns6CfgData.DnsServerList = NULL;\r
       }\r
       goto ON_EXIT;\r
     }\r