Add handler for /size/<number>#1
Open
anfernee wants to merge 1 commit into
Open
Conversation
This handler will send an output of <number> bytes (all `x`s) back to the client. This can be used to test return path of fragmented packets. Signed-off-by: Yongkun Gui <ygui@google.com>
This was referenced Jun 22, 2021
pchaigno
reviewed
Jul 9, 2021
Member
There was a problem hiding this comment.
Sorry for the delay to review. Few people receive notifications for pull requests opened on these small repositories, so it's best to ping us via Slack.
It seems some additional filtering could be useful on input values:
2021/07/09 14:09:55 Listening on: ":69"
2021/07/09 14:10:12 Read "size/-1" requested from 127.0.0.1:42234
panic: strings: negative Repeat count
goroutine 8 [running]:
strings.Repeat(0x5e034a, 0x1, 0xffffffffffffffff, 0x0, 0x0)
/usr/local/go/src/strings/strings.go:533 +0x5aa
main.echoHandler(0x61d960, 0xc00000e100)
/go/src/app/main.go:64 +0x2b5
pack.ag/tftp.ReadHandlerFunc.ServeTFTP(0x5ebd98, 0x61d960, 0xc00000e100)
/go/pkg/mod/pack.ag/tftp@v1.0.0/handlers.go:201 +0x3a
pack.ag/tftp.(*Server).dispatchReadRequest(0xc0000da000, 0xc00000e0a0, 0xc0000561e0)
/go/pkg/mod/pack.ag/tftp@v1.0.0/server.go:220 +0x384
created by pack.ag/tftp.(*Server).connManager
/go/pkg/mod/pack.ag/tftp@v1.0.0/server.go:147 +0x1ef
Also:
$ curl tftp://127.0.0.1:69/size/0
curl: (71) invalid tsize -:0:- value in OACK packet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This handler will send an output of bytes (all
xs) back tothe client. This can be used to test return path of fragmented packets.
Signed-off-by: Yongkun Gui ygui@google.com