From 3ed87720b3680e5224b873fecb7048812fff8cfa Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Tue, 6 Jun 2023 11:34:14 +0200 Subject: [PATCH] osmo_io: Don't make msg in write_cb const This was discussed in a previous change, but the change was merged as-is. Change-Id: I8b4a2dd7a336dea5c52c9da6e78bbc4d5f2a02f8 --- include/osmocom/core/osmo_io.h | 4 ++-- src/gb/gprs_ns2_udp.c | 2 +- tests/osmo_io/osmo_io_test.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h index a539c8b6d..a5e616542 100644 --- a/include/osmocom/core/osmo_io.h +++ b/include/osmocom/core/osmo_io.h @@ -41,7 +41,7 @@ struct osmo_io_ops { void (*read_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg); /*! call-back function when write has completed on fd */ void (*write_cb)(struct osmo_io_fd *iofd, int res, - const struct msgb *msg); + struct msgb *msg); /*! call-back function to segment the data at message boundaries. * Needs to return the size of the next message. If it returns * -EAGAIN or a value larger than msgb_length() (message is incomplete) @@ -58,7 +58,7 @@ struct osmo_io_ops { const struct osmo_sockaddr *saddr); /*! call-back function emulating sendto */ void (*sendto_cb)(struct osmo_io_fd *iofd, int res, - const struct msgb *msg, + struct msgb *msg, const struct osmo_sockaddr *daddr); }; }; diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c index e9e9e38bb..0fc1b4b7b 100644 --- a/src/gb/gprs_ns2_udp.c +++ b/src/gb/gprs_ns2_udp.c @@ -223,7 +223,7 @@ out: } static void handle_nsip_sendto(struct osmo_io_fd *iofd, int res, - const struct msgb *msg, + struct msgb *msg, const struct osmo_sockaddr *daddr) { struct gprs_ns2_vc_bind *bind = osmo_iofd_get_data(iofd); diff --git a/tests/osmo_io/osmo_io_test.c b/tests/osmo_io/osmo_io_test.c index 19919264d..bb99b5407 100644 --- a/tests/osmo_io/osmo_io_test.c +++ b/tests/osmo_io/osmo_io_test.c @@ -49,7 +49,7 @@ static void read_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg) talloc_free(msg); } -static void write_cb(struct osmo_io_fd *iofd, int rc, const struct msgb *msg) +static void write_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg) { printf("%s: write() returned rc=%d\n", osmo_iofd_get_name(iofd), rc); } @@ -109,7 +109,7 @@ static void recvfrom_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg, talloc_free(msg); } -static void sendto_cb(struct osmo_io_fd *iofd, int rc, const struct msgb *msg, +static void sendto_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg, const struct osmo_sockaddr *daddr) { printf("%s: sendto() returned rc=%d\n", osmo_iofd_get_name(iofd), rc);