Skip to content

net: Description of net_pkt_skip() is not clear #14093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pfalcon opened this issue Mar 6, 2019 · 0 comments
Closed

net: Description of net_pkt_skip() is not clear #14093

pfalcon opened this issue Mar 6, 2019 · 0 comments
Assignees
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Milestone

Comments

@pfalcon
Copy link
Collaborator

pfalcon commented Mar 6, 2019

Current docstring of net_pkt_skip() (as introduced in b039625) reads:

 * @brief Skip some data from a net_pkt
 *
 * Note: net_pkt's cursor should be properly initialized
 *       Cursor will be updated according to parameter.
 *       Depending on the value of pkt->overwrite bit, this function
 *       will affect the buffer length or not: if it's 0, skip will
 *       actually apply the move in the buffer as it had written in it.

Specifically, the behavior re: pkt->overwrite isn't very clear. Neither "if it's 0" part is clear. For me it reads as: "If overwrite set to false, actually overwrite something in the packet". Can it be reworded to avoid such interpretations? Or perhaps, we really have an API clarity issue here? Maybe the function should be renamed, e.g. to net_pkt_seek() (but the question rises re: backward seeks).

@pfalcon pfalcon added bug The issue is a bug, or the PR is fixing a bug area: Networking labels Mar 6, 2019
@nashif nashif added the priority: low Low impact/importance bug label Mar 6, 2019
@tbursztyka tbursztyka added this to the v1.14.0 milestone Mar 14, 2019
tbursztyka pushed a commit to tbursztyka/zephyr that referenced this issue Mar 22, 2019
Its behavior varies whether overwrite bit is set or not, so detailing
this more carefully.

Fixes zephyrproject-rtos#14093

Signed-off-by: Tomasz Bursztyka <[email protected]>
@nashif nashif closed this as completed in 632e3fb Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants