MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.

This patch updates IP4 stack to support 32bit subnet mask in PXE boot process.
When 32bit subnet mask is used, the IP4 driver couldn't use the subnet mask to determine
whether destination IP address is on-link or not, so it will always try to send all the
packets to the destination IP address directly first, if failed it will continue
to try the default gateway.

Contributed-under: TianoCore Contribution Agreement 1.1
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
2018-08-28 09:48:32 +08:00
parent 1e57188216
commit 12ae56cf28
10 changed files with 164 additions and 34 deletions

View File

@ -509,8 +509,9 @@ Mtftp4Start (
goto ON_ERROR;
}
gBS->RestoreTPL(OldTpl);
if (Token->Event != NULL) {
gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@ -522,7 +523,6 @@ Mtftp4Start (
This->Poll (This);
}
gBS->RestoreTPL (OldTpl);
return Token->Status;
ON_ERROR:
@ -682,7 +682,7 @@ EfiMtftp4Configure (
}
if ((Gateway != 0) &&
(!IP4_NET_EQUAL (Gateway, Ip, Netmask) || (Netmask != 0 && !NetIp4IsUnicast (Gateway, Netmask)))) {
((Netmask != 0xFFFFFFFF && !IP4_NET_EQUAL (Gateway, Ip, Netmask)) || (Netmask != 0 && !NetIp4IsUnicast (Gateway, Netmask)))) {
return EFI_INVALID_PARAMETER;
}