mirror of https://gerrit.osmocom.org/libosmocore
msgb: Also copy msgb {dst, lchan, cb} during msgb_copy_*
It wasn't really specified if those fields are supposed to be copied. But after all, a copy is supposed to behave exactly like the original, not just in terms of the data but all aspects. Change-Id: I68328adb952ca8833ba047cb3b49ccc6f8a1f1b5
This commit is contained in:
parent
0a24e9140d
commit
c673eee4f4
|
@ -356,6 +356,11 @@ struct msgb *msgb_copy_resize_c(const void *ctx, const struct msgb *msg, uint16_
|
|||
if (msg->l4h)
|
||||
new_msg->l4h = new_msg->_data + (msg->l4h - msg->_data);
|
||||
|
||||
/* copy other metadata like cb */
|
||||
new_msg->dst = msg->dst;
|
||||
new_msg->lchan = msg->lchan;
|
||||
memcpy(new_msg->cb, msg->cb, sizeof(new_msg->cb));
|
||||
|
||||
return new_msg;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue