Skip to content

Discussion: How should netdev_driver_t::recv() behave when buffer is too small #10413

@maribu

Description

@maribu

Description

The documentation states that the driver return -ENOBUFS when recv() was called with a buffer too small to hold the incoming frame. But two questions are remain to be decided:

  • Should the frame be dropped in that case implicitly? Or should the upper layer decide by either asking the driver to drop the frame explicitly in a subsequent call, or by providing a bigger buffer in a subsequent call?
  • Should the part of the frame fitting in the buffer still be retrieved?

Also: Some drivers seem to silently truncate the frame in this case instead of returning an error. This should be tracked an fixed. I suggest to first decide on the questions above and than make sure that all drivers comply with this API

Metadata

Metadata

Labels

Discussion: RFCThe issue/PR is used as a discussion starting point about the item of the issue/PRType: questionThe issue poses a question regarding usage of RIOT

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions