MdeModulePkg: 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:08 +08:00
parent 3289dcba45
commit 01b5ac880f
14 changed files with 83 additions and 77 deletions

View File

@ -1029,7 +1029,9 @@ IpIoListenHandlerDpc (
if (IpIo->IpVersion == IP_VERSION_4) {
if ((EFI_IP4 (RxData->Ip4RxData.Header->SourceAddress) != 0) &&
!NetIp4IsUnicast (EFI_NTOHL (((EFI_IP4_RECEIVE_DATA *) RxData)->Header->SourceAddress), 0)) {
(IpIo->SubnetMask != 0) &&
IP4_NET_EQUAL (IpIo->StationIp, EFI_NTOHL (((EFI_IP4_RECEIVE_DATA *) RxData)->Header->SourceAddress), IpIo->SubnetMask) &&
!NetIp4IsUnicast (EFI_NTOHL (((EFI_IP4_RECEIVE_DATA *) RxData)->Header->SourceAddress), IpIo->SubnetMask)) {
//
// The source address is not zero and it's not a unicast IP address, discard it.
//
@ -1300,6 +1302,11 @@ IpIoOpen (
if (OpenData->IpConfigData.Ip4CfgData.RawData) {
return EFI_UNSUPPORTED;
}
if (!OpenData->IpConfigData.Ip4CfgData.UseDefaultAddress) {
IpIo->StationIp = EFI_NTOHL (OpenData->IpConfigData.Ip4CfgData.StationAddress);
IpIo->SubnetMask = EFI_NTOHL (OpenData->IpConfigData.Ip4CfgData.SubnetMask);
}
Status = IpIo->Ip.Ip4->Configure (
IpIo->Ip.Ip4,