aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2017-11-30 16:57:39 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2018-01-30 18:59:28 +0100
commitf7dffb02d96aafd10698bb4ed0de51ff40a6c156 (patch)
tree96c278e22a68907218c743e4051ed4df3d6db552 /openbsc/src
parentdad6ed7a66838787322e458032d637d1aca89e59 (diff)
bsc_nat: Fix return value in bsc_read_cb when connection was closed
osmo_fd will otherwise call the write_cb if data was enqueued for writing - possibly reading from/writing to free()d data. Change-Id: Ic11c710a7ef61272fee9a952a42052948e3d38fe
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 8c4561133..1f56535d1 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1341,7 +1341,7 @@ static int ipaccess_bsc_read_cb(struct osmo_fd *bfd)
bsc->cfg ? bsc->cfg->nr : -1, ret, strerror(-ret));
bsc_close_connection(bsc);
- return -1;
+ return -EBADF;
}