aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-03-31 13:42:11 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-04-01 13:40:59 +0200
commite827812051f1597db89da2b90e2899b5cd1955ea (patch)
tree6f1225e43215499ed079688e13fcf41021c465c9 /openbsc/src/osmo-bsc
parent8a158bb1ea36d0f88da18d0f034884b30f09fda2 (diff)
ipa: Use enhanced ipa_msg_recv_buffered() to cope with partioned IPA messages
The old ipa_msg_recv() implementation didn't support partial receive, so IPA connections got disconnected when this happened. This patch adds the handling of the temporary message buffers and uses ipa_msg_recv_buffered(). It has been successfully tested by jerlbeck with osmo-nitb and osmo-bsc. Ticket: OW#768 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/osmo-bsc')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_msc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c
index 603398551..04e9cf3a7 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c
@@ -247,13 +247,15 @@ static void osmo_ext_handle(struct osmo_msc_data *msc, struct msgb *msg)
static int ipaccess_a_fd_cb(struct osmo_fd *bfd)
{
- struct msgb *msg;
+ struct msgb *msg = NULL;
struct ipaccess_head *hh;
struct osmo_msc_data *data = (struct osmo_msc_data *) bfd->data;
int ret;
- ret = ipa_msg_recv(bfd->fd, &msg);
+ ret = ipa_msg_recv_buffered(bfd->fd, &msg, &data->msc_con->pending_msg);
if (ret <= 0) {
+ if (ret == -EAGAIN)
+ return 0;
if (ret == 0) {
LOGP(DMSC, LOGL_ERROR, "The connection to the MSC was lost.\n");
bsc_msc_lost(data->msc_con);