MdeModulePkg/Network: Fix potential ASSERT if NetIp4IsUnicast is called

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
This commit is contained in:
Jiaxin Wu
2017-03-21 11:36:04 +08:00
parent cab6b79cf4
commit d0e76ac5ce
5 changed files with 16 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
/** @file
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -172,7 +172,7 @@ Udp4Configure (
if (!UdpConfigData->UseDefaultAddress &&
(!IP4_IS_VALID_NETMASK (SubnetMask) ||
!((StationAddress == 0) || NetIp4IsUnicast (StationAddress, SubnetMask)) ||
!((StationAddress == 0) || (SubnetMask != 0 && NetIp4IsUnicast (StationAddress, SubnetMask))) ||
IP4_IS_LOCAL_BROADCAST (RemoteAddress))) {
//
// Don't use default address, and subnet mask is invalid or StationAddress is not