summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-24 06:38:04 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-07 23:23:16 +0000
commit5ecdc56ad4a435d923fd3982769ac94b52f103a7 (patch)
tree097a997638822084987b6ab8268002b0a237fb2e
parent9cacb6f74b73f90d79aa53f707124cceee19f8af (diff)
fix: properly handle error rc by osmo_gsup_conn_ccm_get()
-rw-r--r--src/gsup_server.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gsup_server.c b/src/gsup_server.c
index d431637..b0e1858 100644
--- a/src/gsup_server.c
+++ b/src/gsup_server.c
@@ -185,9 +185,15 @@ static int osmo_gsup_server_ccm_cb(struct ipa_server_conn *conn,
osmo_tlvp_dump(tlvp, DLGSUP, LOGL_INFO);
addr_len = osmo_gsup_conn_ccm_get(clnt, &addr, IPAC_IDTAG_SERNR);
- if (addr_len)
- gsup_route_add(clnt, addr, addr_len);
+ if (addr_len <= 0) {
+ LOGP(DLGSUP, LOGL_ERROR, "GSUP client %s:%u has no %s IE and"
+ " cannot be routed\n",
+ conn->addr, conn->port,
+ ipa_ccm_idtag_name(IPAC_IDTAG_SERNR));
+ return -EINVAL;
+ }
+ gsup_route_add(clnt, addr, addr_len);
return 0;
}