daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/37673?usp=email )


Change subject: ipa: Ensure osmo_ipa_segmentation_cb sets msg->l2h to the 
payload data
......................................................................

ipa: Ensure osmo_ipa_segmentation_cb sets msg->l2h to the payload data

Previously if ih->proto was IPAC_PROTO_OSMO msg->l2h would still point
to the extension header byte which breaks assumptions in e.g. osmo-bsc.

Change-Id: Id91cddf9948ca49abf092850fae3a8f17e445b45
Related: OS#6422
---
M src/ipa.c
1 file changed, 16 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/73/37673/1

diff --git a/src/ipa.c b/src/ipa.c
index 8720427..d43df00 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -375,7 +375,8 @@
 #define MSG_CB_IPA_INFO_OFFSET 0

 /* Check and remove headers (in case of p == IPAC_PROTO_OSMO, also the IPA 
extension header).
- * Returns a negative number on error, otherwise the number of octets removed 
*/
+ * Returns a negative number on error, otherwise the number of octets removed.
+ * Both msg->data and msg->l2h point to the user data after the (extended) IPA 
header if this function is successful. */
 static inline int ipa_check_pull_headers(struct msgb *msg)
 {
        int ret;
@@ -397,6 +398,7 @@
        osmo_ipa_msgb_cb_proto_ext(msg) = msg->data[0];
        msgb_pull(msg, sizeof(struct ipa_head_ext));
        octets_removed += sizeof(struct ipa_head_ext);
+       msg->l2h = msg->data;
        return octets_removed;
 }


--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/37673?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: rel-1.5.1
Gerrit-Change-Id: Id91cddf9948ca49abf092850fae3a8f17e445b45
Gerrit-Change-Number: 37673
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <[email protected]>
Gerrit-MessageType: newchange

Reply via email to