From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 73FE62195406F for ; Thu, 20 Apr 2017 18:50:15 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2017 18:50:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,227,1488873600"; d="scan'208";a="92064835" Received: from sfu5-mobl3.ccr.corp.intel.com ([10.239.193.185]) by fmsmga005.fm.intel.com with ESMTP; 20 Apr 2017 18:50:14 -0700 From: Fu Siyuan To: edk2-devel@lists.01.org Cc: Ye Ting , Wu Jiaxin Date: Fri, 21 Apr 2017 09:50:04 +0800 Message-Id: <1492739404-13540-1-git-send-email-siyuan.fu@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 Subject: [Patch] MdeModulePkg: Discard received broadcast message in DxeIpIpLib. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2017 01:50:15 -0000 Cc: Ye Ting Cc: Wu Jiaxin Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan --- MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c index 9a70e90..abc07fb 100644 --- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c +++ b/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) && -- 2.7.4.windows.1