mirror of https://gerrit.osmocom.org/libosmocore
msgb: Allow size==headroom in msgb_alloc_headroom*()
Nothinh really forbids this case, it's totally fine allocating all space of msgb as headroom. osmo-pcu actually does that in gprs_rlcmac_ul_tbf::snd_ul_ud(). Related: OS#4029 Change-Id: Ibe05d08e3169a2603e891f76682a3b352a93ec7a
This commit is contained in:
parent
7bfaba51b0
commit
ec4b62705d
|
@ -518,7 +518,7 @@ static inline int msgb_l3trim(struct msgb *msg, int l3len)
|
||||||
static inline struct msgb *msgb_alloc_headroom_c(const void *ctx, int size, int headroom,
|
static inline struct msgb *msgb_alloc_headroom_c(const void *ctx, int size, int headroom,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
osmo_static_assert(size > headroom, headroom_bigger);
|
osmo_static_assert(size >= headroom, headroom_bigger);
|
||||||
|
|
||||||
struct msgb *msg = msgb_alloc_c(ctx, size, name);
|
struct msgb *msg = msgb_alloc_c(ctx, size, name);
|
||||||
if (msg)
|
if (msg)
|
||||||
|
@ -540,7 +540,7 @@ static inline struct msgb *msgb_alloc_headroom_c(const void *ctx, int size, int
|
||||||
static inline struct msgb *msgb_alloc_headroom(int size, int headroom,
|
static inline struct msgb *msgb_alloc_headroom(int size, int headroom,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
osmo_static_assert(size > headroom, headroom_bigger);
|
osmo_static_assert(size >= headroom, headroom_bigger);
|
||||||
|
|
||||||
struct msgb *msg = msgb_alloc(size, name);
|
struct msgb *msg = msgb_alloc(size, name);
|
||||||
if (msg)
|
if (msg)
|
||||||
|
|
Loading…
Reference in New Issue