]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
MdeModulePkg: Update IP4 stack drivers for classless address unicast check.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Udp4Dxe / Udp4Main.c
index 5ea22acb14f96c4f71c7cb41134fc6c3b340dc3b..bdb79b3abde33a52b1c38aa7c6479b5dc70126ff 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, 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
@@ -171,9 +171,9 @@ Udp4Configure (
 \r
 \r
     if (!UdpConfigData->UseDefaultAddress &&\r
-      (!IP4_IS_VALID_NETMASK (SubnetMask) ||\r
-      !((StationAddress == 0) || NetIp4IsUnicast (StationAddress, SubnetMask)) ||\r
-      !((RemoteAddress  == 0) || NetIp4IsUnicast (RemoteAddress, 0)))) {\r
+        (!IP4_IS_VALID_NETMASK (SubnetMask) ||\r
+         !((StationAddress == 0) || NetIp4IsUnicast (StationAddress, SubnetMask)) ||\r
+         IP4_IS_LOCAL_BROADCAST (RemoteAddress))) {\r
       //\r
       // Don't use default address, and subnet mask is invalid or StationAddress is not\r
       // a valid unicast IPv4 address or RemoteAddress is not a valid unicast IPv4 address\r