}\r
\r
if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&\r
- !NetIp4IsUnicast (EFI_NTOHL (RxData->Header->SourceAddress), 0)) {\r
+ (NTOHL (Mode->SubnetMask.Addr[0]) != 0) &&\r
+ IP4_NET_EQUAL (NTOHL(Mode->StationIp.Addr[0]), EFI_NTOHL (RxData->Header->SourceAddress), NTOHL (Mode->SubnetMask.Addr[0])) &&\r
+ !NetIp4IsUnicast (EFI_NTOHL (RxData->Header->SourceAddress), NTOHL (Mode->SubnetMask.Addr[0]))) {\r
//\r
// The source address is not zero and it's not a unicast IP address, discard it.\r
//\r
if ((This == NULL) ||\r
(Filename == NULL) ||\r
(BufferSize == NULL) ||\r
- ((ServerIp == NULL) || !NetIp4IsUnicast (NTOHL (ServerIp->Addr[0]), 0)) ||\r
+ ((ServerIp == NULL) || \r
+ (IP4_IS_UNSPECIFIED (NTOHL (ServerIp->Addr[0])) || \r
+ IP4_IS_LOCAL_BROADCAST (NTOHL (ServerIp->Addr[0])))) ||\r
((BufferPtr == NULL) && DontUseBuffer) ||\r
((BlockSize != NULL) && (*BlockSize < 512))) {\r
\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if ((GatewayIp != NULL) && !NetIp4IsUnicast (NTOHL (GatewayIp->Addr[0]), 0)) {\r
+ if ((GatewayIp != NULL) && (IP4_IS_UNSPECIFIED (NTOHL (GatewayIp->Addr[0])) || IP4_IS_LOCAL_BROADCAST (NTOHL (GatewayIp->Addr[0])))) {\r
//\r
// Gateway is provided but it's not a unicast IP address.\r
//\r
DEBUG ((EFI_D_ERROR, "There is broadcast address in NewFilter.\n"));\r
return EFI_INVALID_PARAMETER;\r
}\r
- if (NetIp4IsUnicast (EFI_IP4 (NewFilter->IpList[Index].v4), 0) &&\r
- ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) != 0)\r
- ) {\r
+ if ((EFI_NTOHL(Mode->StationIp) != 0) &&\r
+ (EFI_NTOHL(Mode->SubnetMask) != 0) &&\r
+ IP4_NET_EQUAL(EFI_NTOHL(Mode->StationIp), EFI_NTOHL(NewFilter->IpList[Index].v4), EFI_NTOHL(Mode->SubnetMask)) &&\r
+ NetIp4IsUnicast (EFI_IP4 (NewFilter->IpList[Index].v4), EFI_NTOHL(Mode->SubnetMask)) &&\r
+ ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) != 0)) {\r
//\r
// If EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP is set and IP4 address is in IpList,\r
// promiscuous mode is needed.\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (NewStationIp != NULL && !NetIp4IsUnicast (NTOHL (NewStationIp->Addr[0]), 0)) {\r
+ if (NewSubnetMask != NULL && !IP4_IS_VALID_NETMASK (NTOHL (NewSubnetMask->Addr[0]))) {\r
return EFI_INVALID_PARAMETER;\r
}\r
-\r
- if (NewSubnetMask != NULL && !IP4_IS_VALID_NETMASK (NTOHL (NewSubnetMask->Addr[0]))) {\r
+ \r
+ if (NewStationIp != NULL && !NetIp4IsUnicast (NTOHL (NewStationIp->Addr[0]), NTOHL (NewSubnetMask->Addr[0]))) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r