aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/gtphub.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-12-20 17:02:15 +0100
committerHarald Welte <laforge@gnumonks.org>2018-01-27 17:05:27 +0000
commit99f99535e52e665cfd1da38d2c9842fd12b13420 (patch)
tree55fa46e47d84b54dc9ffb25854555f711a2a076e /src/gprs/gtphub.c
parent54e4849877e98f7fb0e8ca0f170052e856bd60dc (diff)
gtphub: check for gsn_addr_from_sockaddr() errors
Previously the return value was ignored. Check it and log error message. Change-Id: If6babdad650dc6a84e6a784fc8d3c5abe146ecc1
Diffstat (limited to 'src/gprs/gtphub.c')
-rw-r--r--src/gprs/gtphub.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c
index b0e75ca..2ff1b7c 100644
--- a/src/gprs/gtphub.c
+++ b/src/gprs/gtphub.c
@@ -1583,7 +1583,9 @@ static int gtphub_handle_create_pdp_ctx(struct gtphub *hub,
* gtphub_handle_buf(), we'd be creating a peer port just to
* expire it right away. */
if (hub->sgsn_use_sender && (side_idx == GTPH_SIDE_SGSN)) {
- gsn_addr_from_sockaddr(&use_addr, &use_port, &from_ctrl->sa);
+ int rc = gsn_addr_from_sockaddr(&use_addr, &use_port, &from_ctrl->sa);
+ if (rc < 0)
+ LOG(LOGL_ERROR, "%s(): failed to obtain GSN address\n", __func__);
} else {
use_port = gtphub_plane_idx_default_port[plane_idx];
@@ -2765,7 +2767,9 @@ struct gtphub_peer_port *gtphub_known_addr_have_port(const struct gtphub_bind *b
struct gsn_addr gsna;
uint16_t port;
- gsn_addr_from_sockaddr(&gsna, &port, addr);
+ int rc = gsn_addr_from_sockaddr(&gsna, &port, addr);
+ if (rc < 0)
+ LOG(LOGL_ERROR, "%s(): failed to obtain GSN address\n", __func__);
pa = gtphub_addr_find(bind, &gsna);
if (!pa)