| 76c33870 | 22-May-2026 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
tftpd: Simplify packet drop macro
The first argument is always the function name, for which we can simply use __func__. This leaves only the optional return value, so we can use a single variadic m
tftpd: Simplify packet drop macro
The first argument is always the function name, for which we can simply use __func__. This leaves only the optional return value, so we can use a single variadic macro instead of two nearly-identical copies.
MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57076
show more ...
|
| 25945af4 | 10-May-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
tftpd: silence gcc overflow warnings
GCC 13 complains that we might be writing too much to an on-stack buffer when createing a filename.
In practice there is a check that filename isn't too long gi
tftpd: silence gcc overflow warnings
GCC 13 complains that we might be writing too much to an on-stack buffer when createing a filename.
In practice there is a check that filename isn't too long given the time format and other static characters so GCC is incorrect, but GCC isn't wrong that we're potentially trying to put a MAXPATHLEN length string + some other characters into a MAXPATHLEN buffer (if you ignore the check GCC can't realistically evaluate at compile time).
Switch to snprintf to populate filename to ensure that future logic errors don't result in a stack overflow.
Shorten the questionably named yyyymmdd buffer enough to slience the warning (checking the snprintf return value isn't sufficent) while preserving maximum flexibility for admins who use the -F option.
MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D45086
show more ...
|
| 4d09eb87 | 10-May-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
tftpd: Satisfy clang-analyzer.
* Replace `random()` with `arc4random()`. * Change some variable types. * Drop some unused assignments.
MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp,
tftpd: Satisfy clang-analyzer.
* Replace `random()` with `arc4random()`. * Change some variable types. * Drop some unused assignments.
MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D45132
show more ...
|
| ae285a8c | 10-May-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
tftpd: Add missing include.
This went unnoticed due to namespace pollution in our headers.
MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebs
tftpd: Add missing include.
This went unnoticed due to namespace pollution in our headers.
MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45131
show more ...
|
| 83a6e984 | 25-Apr-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
tftpd: Check the server status after each test.
* In the setup phase, wait for the server to start (or fail to start) before proceeding with the test. This makes it possible to write test cases
tftpd: Check the server status after each test.
* In the setup phase, wait for the server to start (or fail to start) before proceeding with the test. This makes it possible to write test cases that don't expect a response from the server without ending up in a race over the server PID file. * After running each test, wait up to 30 seconds for the server to exit and check that the exit status matches what the test case says to expect (usually 0). * We still kill and collect the server in the cleanup phase, in case the test ended early.
MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44956
show more ...
|
| 615d167c | 20-Jul-2023 |
Dmitry Morozovsky <marck@FreeBSD.org> |
Revert "tftpd: fix double-colon typo in option string"
It was not a typo: -d takes an optional argument, which is indicated with a double colon.
This reverts commit 3cbc8e752b92442c784306731e94fd90
Revert "tftpd: fix double-colon typo in option string"
It was not a typo: -d takes an optional argument, which is indicated with a double colon.
This reverts commit 3cbc8e752b92442c784306731e94fd904de3373c.
Spotted by: kevans
show more ...
|