MdeModulePkg: Discard received broadcast message in DxeIpIoLib.

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 2017-04-21 09:48:09 +08:00
parent 176eb3a17e
commit dd29d8b356
1 changed files with 6 additions and 0 deletions

View File

@ -1028,6 +1028,12 @@ IpIoListenHandlerDpc (
}
if (IpIo->IpVersion == IP_VERSION_4) {
if (IP4_IS_LOCAL_BROADCAST (EFI_IP4 (RxData->Ip4RxData.Header->SourceAddress))) {
//
// The source address is a broadcast address, discard it.
//
goto CleanUp;
}
if ((EFI_IP4 (RxData->Ip4RxData.Header->SourceAddress) != 0) &&
(IpIo->SubnetMask != 0) &&
IP4_NET_EQUAL (IpIo->StationIp, EFI_NTOHL (((EFI_IP4_RECEIVE_DATA *) RxData)->Header->SourceAddress), IpIo->SubnetMask) &&