Skip to content

tftp: preserve options in decoded read and write requests - #695

Open
omrzk wants to merge 1 commit into
kbandla:masterfrom
omrzk:fix/tftp-request-options
Open

omrzk wants to merge 1 commit into
kbandla:masterfrom
omrzk:fix/tftp-request-options

Conversation

@omrzk

@omrzk omrzk commented Nov 2, 2026

Copy link
Copy Markdown

TFTP read and write requests can carry RFC 2347 option/value pairs after the filename and mode. Decoding currently drops those bytes, so repacking a captured request silently removes parameters such as blksize and tsize.

Retain the suffix in TFTP.data, preserving the existing filename/mode API and allowing requests to be edited and repacked without losing their options.

Validation: the new regression fails on unchanged master and passes with the fix. It covers read/write requests, single/multiple options and filename edits. All 454 tests pass (99% coverage); required syntax/undefined-name lint, changed-file full lint and compileall pass on Python 3.12.3. The existing optionless, DATA, ERR and unknown-opcode tests pass. This is packet-fixture testing; no external TFTP server was exercised. Python 2.7 and the older CI interpreter matrix were unavailable locally.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant