-
Notifications
You must be signed in to change notification settings - Fork 2k
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
rpl: refactor send_dao to use pktbuf properly #4202
Conversation
nice one, ripping the |
size += sizeof(gnrc_rpl_opt_dodag_conf_t); | ||
if (dodag->prefix_info_requested) { | ||
if ((pkt = _dio_prefix_info_build(pkt, dodag)) == NULL) { | ||
return; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
is this an ACK? (: |
not yet, but close to ;) |
tested on native, works, travis is happy, ACK'n'Go |
rpl: refactor send_dao to use pktbuf properly
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.