MdeModulePkg/Ip4Dxe: Add Ip/Netmask pair check for Ip4Config2

v2:
* Add the check in Ip4Config2SetDefaultIf to avoid the DHCP configuration
case.

Ip4config2 doesn't check the validity of Ip/Netmask pair, which
leads to the invalid combination of Ip and Netmask setting.
This patch is to resolve the issue.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.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: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
This commit is contained in:
Jiaxin Wu
2017-03-16 09:39:34 +08:00
parent d948cf838e
commit f1222593f2
5 changed files with 94 additions and 71 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Implement IP4 pesudo interface.
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2005 - 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
@@ -560,15 +560,9 @@ Ip4SetAddress (
{
EFI_ARP_CONFIG_DATA ArpConfig;
EFI_STATUS Status;
INTN Len;
NET_CHECK_SIGNATURE (Interface, IP4_INTERFACE_SIGNATURE);
Len = NetGetMaskLength (SubnetMask);
if (Len == IP4_MASK_NUM) {
return EFI_INVALID_PARAMETER;
}
//
// Set the ip/netmask, then compute the subnet broadcast
// and network broadcast for easy access. When computing