Attention is currently required from: pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32644 )
Change subject: sm: Fix APN IE content not transmitted in Act PDP Ctx Req ......................................................................
Patch Set 1:
(1 comment)
File src/sm/sm_pdu.c:
https://gerrit.osmocom.org/c/libosmo-gprs/+/32644/comment/53f4dccf_e435f555 PS1, Line 208: rc = osmo_apn_from_str(msg->tail, msgb_tailroom(msg), sme->apn); : if (rc < 0) : return -EINVAL; : *l = rc; : msgb_put(msg, *l); IMHO this is highly unusual: passing a pointer to msg->tail and storing some data before doing the msgb_put. All the "legacy" code that I recall does the msgb_put() first. It would at that point ASSERT if we ever overrun msgb_tailroom, before anything is memcpying over it.
The approach you take is to potentially encode zero-length IEs in case msgb_tailroom() ever goes to zero. I'm not really sure if that's any better...