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:
@ -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,
|
||||
|
Reference in New Issue
Block a user