diff options
author | Fu Siyuan <siyuan.fu@intel.com> | 2016-10-27 09:23:08 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2016-10-28 14:20:10 +0800 |
commit | 01b5ac880f00cf89833e6fc80666bccc9779dea7 (patch) | |
tree | 7809986a78952db2dfec814b5b94adca13d17f17 /MdeModulePkg/Library/DxeIpIoLib | |
parent | 3289dcba45e48af5c4fd329f57c49cc8e5830ed8 (diff) | |
download | edk2-01b5ac880f00cf89833e6fc80666bccc9779dea7.zip edk2-01b5ac880f00cf89833e6fc80666bccc9779dea7.tar.gz edk2-01b5ac880f00cf89833e6fc80666bccc9779dea7.tar.bz2 |
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>
Diffstat (limited to 'MdeModulePkg/Library/DxeIpIoLib')
-rw-r--r-- | MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c index 27fef71..9a70e90 100644 --- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c +++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c @@ -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,
|