diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-06-10 14:33:46 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2021-06-13 18:20:09 +0000 |
commit | af40b0b6b9f022f727dcf992d867ba7fe8f318bf (patch) | |
tree | 5ba55766b353c912cfd5f42d27f0171af445f21a /include/osmocom/core/msgb.h | |
parent | 42bb125df17dd334a56d0654c756fd893be614ab (diff) |
msgb_alloc_headroom: Change size args to be uint16_t
Underlaying APIs (msgb_alloc) use a uint16_t as a type, which means
until now passing a value > 2^16 would succeed providing a msgb with
less space than requested.
Since those are static inline, there's no symbols used by apps, so we
should be safe enough changing the type to be uint16_t, since change
would only be applied at re-compile time.
Change-Id: I83c8222484e4856c68134a1a9d8cf96eb91af1b8
Diffstat (limited to 'include/osmocom/core/msgb.h')
-rw-r--r-- | include/osmocom/core/msgb.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index cc76e3ad..df796c99 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -524,7 +524,7 @@ static inline int msgb_l3trim(struct msgb *msg, int l3len) * followed by \ref msgb_reserve in order to create a new \ref msgb with * user-specified amount of headroom. */ -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, uint16_t size, uint16_t headroom, const char *name) { osmo_static_assert(size >= headroom, headroom_bigger); @@ -546,7 +546,7 @@ static inline struct msgb *msgb_alloc_headroom_c(const void *ctx, int size, int * followed by \ref msgb_reserve in order to create a new \ref msgb with * user-specified amount of headroom. */ -static inline struct msgb *msgb_alloc_headroom(int size, int headroom, +static inline struct msgb *msgb_alloc_headroom(uint16_t size, uint16_t headroom, const char *name) { osmo_static_assert(size >= headroom, headroom_bigger); |