Skip to content
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

rpl: refactor send_dao to use pktbuf properly #4202

Merged

Conversation

cgundogan
Copy link
Member

The first commit refactors the sending DIO code to make proper use of the pktbuf API instead of pointer arithmetic.
The second commit adds a missing pktbuf release in the sending DAO code.

@cgundogan cgundogan added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: network Area: Networking labels Nov 1, 2015
@cgundogan cgundogan added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 1, 2015
@BytesGalore
Copy link
Member

nice one, ripping the pos pointer casting 👍

size += sizeof(gnrc_rpl_opt_dodag_conf_t);
if (dodag->prefix_info_requested) {
if ((pkt = _dio_prefix_info_build(pkt, dodag)) == NULL) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

OT: shouldn't we do something if the packet cannot be created here and in the further cases below, at least return an error to the caller?

Copy link
Member Author

Choose a reason for hiding this comment

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

the pkt is release in the _*_build funcitons if it wasn't possible to allocate a new buffer

Copy link
Member

Choose a reason for hiding this comment

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

I know, but RPL wrongly assumes now it successfully sent a DIO, and in consequence it will be eventually deleted from the parent sets of its children if this situation sustains

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, there is not much I can do if the pktbuf is full (and stays full for further DIOs). I guess it is good then that children choose another parent

@cgundogan
Copy link
Member Author

nice one, ripping the pos pointer casting 👍

is this an ACK? (:

@BytesGalore
Copy link
Member

not yet, but close to ;)

@BytesGalore
Copy link
Member

tested on native, works, travis is happy, ACK'n'Go

BytesGalore pushed a commit that referenced this pull request Nov 2, 2015
rpl: refactor send_dao to use pktbuf properly
@BytesGalore BytesGalore merged commit f7ecbbc into RIOT-OS:master Nov 2, 2015
@cgundogan cgundogan deleted the pr/rpl/dio_send_pktbuf_refactor branch November 2, 2015 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants