aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-09-26 17:46:27 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-09-26 17:46:30 +0200
commitec4b62705df85a5df06806c4b8b5a04c7e4a5846 (patch)
tree2b018415e63d6be1b2bc0c6434840979b2145e68 /include/osmocom
parent7bfaba51b0477cbb87743cc45c64fad6b0b14d8d (diff)
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
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/core/msgb.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index e05d37f0..1833a6c1 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -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,
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);
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,
const char *name)
{
- osmo_static_assert(size > headroom, headroom_bigger);
+ osmo_static_assert(size >= headroom, headroom_bigger);
struct msgb *msg = msgb_alloc(size, name);
if (msg)