-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NetworkPkg: UefiPxeBcDxe: Fix error packet detection #6287
Conversation
Is there anything I can do to help get this reviewed? Would it help to open an issue? Should I try to create a test? |
@SaloniKasbekar @Zclarkwilliams Please review |
Taking a look in bugzilla, I suspect this fixes https://bugzilla.tianocore.org/show_bug.cgi?id=2396. |
Per RFC 1350, TFTP error packets include 2 byte OpCode and ErrorCode fields in network byte order. Those need to be swapped to host order to be interpreted correctly. Without this change, the TftpErrorReceived and TftpError Mode fields are never set and EFI applications can't inspect the error received from the TFTP server. Signed-off-by: Dan Nicholson <[email protected]>
5a39ca0
to
16d213d
Compare
May fix Issue #9842 |
I see the specific with rhboot has been resolved in that project. Is this change still required? Would there be any compatibility impacts? |
I think it should be. I wrote the rhboot/shim change and all it does is treat the error as "file not found" if it can't get the error details from UEFI. See rhboot/shim@6410312#diff-874c9b6e2bf4c63b0f0a443f612426773d76e4f09dd313fbe0ad3fd6d42c22d4R415. If it does have access to the error details, it will bubble up a more accurate error. So, the issue is resolved because it will do something reasonable without this fix, but it would be better if it was. |
Understood. I will merge it. |
Description
Per RFC 1350, TFTP error packets include 2 byte OpCode and ErrorCode fields in network byte order. Those need to be swapped to host order to be interpreted correctly. Without this change, the TftpErrorReceived and TftpError Mode fields are never set and EFI applications can't inspect the error received from the TFTP server.
How This Was Tested
I was testing shim to see how it handles TFTP file not found errors in rhboot/shim#695. The OVMF firmware was used to boot a VM using QEMU's TFTP server support. Without this change shim would not report the specific error since
TftpErrorReceived
isFALSE
. With this change it was able to seeTftpErrorReceived
isTRUE
andTftpError.ErrorCode
set to1
, which is file not found as expected.Integration Instructions
N/A, will be included in the UefiPxeBcDxe package.