Skip to content

gcoap_fileserver: can't deal with 16 byte block size #20686

Closed
@benpicco

Description

Description

When requesting 16 byte block size, the server will respond with an invalid packet.

Steps to reproduce the issue

  • run examples/gcoap_fileserver:

    make -C examples/gcoap_fileserver PORT=tap1 all term
    
  • create a dummy file

    echo "Hello World!" > examples/gcoap_fileserver/native/me
    
  • Try to access the file via e.g. ncget with a 16 byte block size

     CFLAGS=-DCONFIG_NANOCOAP_BLOCKSIZE_DEFAULT=COAP_BLOCKSIZE_16 make -C tests/net/nanocoap_cli all term
     > ncget coap://[fe80::d07c:7cff:fe6d:9441]/vfs/me -
    

Expected results

We get the response in a single block

Actual results

We get the response in a single block, but there is some garbage after the block2 option:

Wireshark Output

gcoap_fileserver.pcapng.gz

Versions

RIOT master

Metadata

Assignees

Labels

Area: networkArea: NetworkingType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions