MdeModulePkg: Update IP4 stack drivers for classless address unicast check.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
This commit is contained in:
Fu Siyuan
2016-10-27 09:23:08 +08:00
parent 3289dcba45
commit 01b5ac880f
14 changed files with 83 additions and 77 deletions

View File

@ -2,7 +2,7 @@
Interface routine for Mtftp4.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2016, 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
@ -192,7 +192,7 @@ Mtftp4OverrideValid (
IP4_ADDR Gateway;
CopyMem (&Ip, &Override->ServerIp, sizeof (IP4_ADDR));
if (!NetIp4IsUnicast (NTOHL (Ip), 0)) {
if (IP4_IS_UNSPECIFIED (NTOHL (Ip)) || IP4_IS_LOCAL_BROADCAST (NTOHL (Ip))) {
return FALSE;
}
@ -667,10 +667,6 @@ EfiMtftp4Configure (
Gateway = NTOHL (Gateway);
ServerIp = NTOHL (ServerIp);
if (!NetIp4IsUnicast (ServerIp, 0)) {
return EFI_INVALID_PARAMETER;
}
if (!ConfigData->UseDefaultSetting &&
((!IP4_IS_VALID_NETMASK (Netmask) || !NetIp4IsUnicast (Ip, Netmask)))) {