From 01677e9ac75a50263b836025ca2e58dbefdc97ed Mon Sep 17 00:00:00 2001 From: Fu Siyuan Date: Fri, 21 Apr 2017 09:48:09 +0800 Subject: MdeModulePkg: Discard received broadcast message in DxeIpIoLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Reviewed-by: Ye Ting Reviewed-by: Wu Jiaxin (cherry picked from commit dd29d8b3565ba8ae2e71c097a95b22af5d1d90a4) --- Core/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c b/Core/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c index 9a70e9075d..abc07fb0ff 100644 --- a/Core/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c +++ b/Core/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c @@ -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) && -- cgit v1.2.3