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

@@ -943,9 +943,9 @@ ArpConfigureInstance (
if (ConfigData->SwAddressType == IPV4_ETHER_PROTO_TYPE) {
CopyMem (&Ip, ConfigData->StationAddress, sizeof (IP4_ADDR));
if (!NetIp4IsUnicast (NTOHL (Ip), 0)) {
if (IP4_IS_UNSPECIFIED (Ip) || IP4_IS_LOCAL_BROADCAST (Ip)) {
//
// The station address is not a valid IPv4 unicast address.
// The station address should not be zero or broadcast address.
//
return EFI_INVALID_PARAMETER;
}