]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Discard received broadcast message in DxeIpIoLib.
authorFu Siyuan <siyuan.fu@intel.com>
Fri, 21 Apr 2017 01:48:09 +0000 (09:48 +0800)
committerFu Siyuan <siyuan.fu@intel.com>
Mon, 24 Apr 2017 02:12:09 +0000 (10:12 +0800)
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>
MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c

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