PXE driver bug fix.

1. Update the parameter check of PXE.UdpRead() to align with spec definition.
2. Update PXE driver to use EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP when calling UdpRead to receive server discovery message. 

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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17075 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Fu Siyuan
2015-03-26 04:49:30 +00:00
committed by sfu5
parent 1044ef6be5
commit 903d1fa991
2 changed files with 10 additions and 12 deletions

View File

@@ -1265,7 +1265,7 @@ EfiPxeBcUdpRead (
UINTN FragmentIndex;
UINT8 *FragmentBuffer;
if (This == NULL || DestIp == NULL || DestPort == NULL) {
if (This == NULL) {
return EFI_INVALID_PARAMETER;
}
@@ -1276,9 +1276,9 @@ EfiPxeBcUdpRead (
Udp4Rx = NULL;
Udp6Rx = NULL;
if (((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT) != 0 && DestPort == NULL) ||
((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP) != 0 && SrcIp == NULL) ||
((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT) != 0 && SrcPort == NULL)) {
if (((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT) == 0 && DestPort == NULL) ||
((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP) == 0 && SrcIp == NULL) ||
((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT) == 0 && SrcPort == NULL)) {
return EFI_INVALID_PARAMETER;
}