NetworkPkg: 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:22 +08:00
parent 01b5ac880f
commit 6c12fe63f9
4 changed files with 45 additions and 21 deletions

View File

@@ -258,7 +258,9 @@ PxeBcIcmpErrorDpcHandle (
}
if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&
!NetIp4IsUnicast (EFI_NTOHL (RxData->Header->SourceAddress), 0)) {
(NTOHL (Mode->SubnetMask.Addr[0]) != 0) &&
IP4_NET_EQUAL (NTOHL(Mode->StationIp.Addr[0]), EFI_NTOHL (RxData->Header->SourceAddress), NTOHL (Mode->SubnetMask.Addr[0])) &&
!NetIp4IsUnicast (EFI_NTOHL (RxData->Header->SourceAddress), NTOHL (Mode->SubnetMask.Addr[0]))) {
//
// The source address of the received packet should be a valid unicast address.
//