Skip to content

gnrc_pktbuf_start_write API docs unclear #10261

@jnohlgard

Description

@jnohlgard

gnrc_pktbuf_start_write documentation currently states:

gnrc_pktsnip_t* gnrc_pktbuf_start_write(gnrc_pktsnip_t *pkt)

Must be called once before there is a write operation in a thread.

This function duplicates a packet in the packet buffer if gnrc_pktsnip_t::users of pkt > 1.

Note
Do not call this function in a thread twice on the same packet.

The docs use the word "packet" to refer to a single snip of a complete network packet. Especially the warning about not calling twice on the same packet is confusing since this function is called in a loop in gnrc_pktbuf_reverse_snips()

Originally posted by @gebart in #10226 (comment)

Metadata

Metadata

Labels

Area: docArea: DocumentationArea: networkArea: NetworkingType: enhancementThe issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions