diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2023-08-30 17:07:59 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2023-08-31 14:28:13 +0000 |
commit | f39c23f918dbc62a6708947810f7f6e7d091e106 (patch) | |
tree | da9f0d3bb31489a43b733975ccdaea3493823e22 | |
parent | debian: fix build on ubuntu 20.04 without liburing (diff) | |
download | libosmocore-f39c23f918dbc62a6708947810f7f6e7d091e106.tar.xz libosmocore-f39c23f918dbc62a6708947810f7f6e7d091e106.zip |
osmo_io: Change parent of msghdr to iofd (instead of msg)
msg was made a parent of msghdr after discussion in change
I3a279b55a3adff96948120683c844e1508d0ba94
It turns out this violates some assumptions made in osmo_io,
specifically that the user read callback shall free msg, but we expect
msghdr to remain valid until after that callback returns.
In general I think it is cleaner to make iofd a parent of msghdr.
Change-Id: I41277190e3020cd8fa625bd57a743973e2a65c4b
-rw-r--r-- | src/core/osmo_io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index e1760992..c67787be 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -120,7 +120,7 @@ struct iofd_msghdr *iofd_msghdr_alloc(struct osmo_io_fd *iofd, enum iofd_msg_act talloc_steal(iofd, msg); } - hdr = talloc_zero(msg, struct iofd_msghdr); + hdr = talloc_zero(iofd, struct iofd_msghdr); if (!hdr) { if (free_msg) talloc_free(msg); |