]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/DnsDxe/DnsProtocol.c
NetworkPkg: Fix potential ASSERT if NetIp4IsUnicast is called
[mirror_edk2.git] / NetworkPkg / DnsDxe / DnsProtocol.c
index 6d117b2892d336346d4e633b406fc60936f7fbeb..0e7ed34b4e0c73e9d9691f90aa200b2053d36f33 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