Skip to content

Add handler for /size/<number>#1

Open
anfernee wants to merge 1 commit into
cilium:masterfrom
anfernee:master
Open

Add handler for /size/<number>#1
anfernee wants to merge 1 commit into
cilium:masterfrom
anfernee:master

Conversation

@anfernee
Copy link
Copy Markdown

This handler will send an output of bytes (all xs) back to
the client. This can be used to test return path of fragmented packets.

Signed-off-by: Yongkun Gui ygui@google.com

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>
Copy link
Copy Markdown
Member

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

2 participants