summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-10-24 17:41:03 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-10-24 17:42:57 +0200
commit6e10736190ad3964eea7156316dd8348b20aa601 (patch)
treee9e9c5fc74e922596745e7a826e5e301a26d7bff
parent2b139a65f07bd3afd6fb5c551b8eae2babea978c (diff)
xua: Verify all route ctxs received in ASPAC msg
-rw-r--r--src/xua_asp_fsm.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index db4ffcb..1b39639 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -416,6 +416,9 @@ static void xua_asp_fsm_inactive(struct osmo_fsm_inst *fi, uint32_t event, void
struct osmo_ss7_asp *asp = xafp->asp;
struct xua_msg *xua_in;
uint32_t traf_mode;
+ struct xua_msg_part *part;
+ uint32_t rctx;
+ int i;
check_stop_t_ack(fi, event);
switch (event) {
@@ -456,11 +459,13 @@ static void xua_asp_fsm_inactive(struct osmo_fsm_inst *fi, uint32_t event, void
break;
}
}
- if (xua_msg_find_tag(xua_in, M3UA_IEI_ROUTE_CTX)) {
- uint32_t rctx = xua_msg_get_u32(xua_in, M3UA_IEI_ROUTE_CTX);
- if (!osmo_ss7_as_find_by_rctx(asp->inst, rctx)) {
- peer_send_error(fi, M3UA_ERR_INVAL_ROUT_CTX);
- break;
+ if ((part = xua_msg_find_tag(xua_in, M3UA_IEI_ROUTE_CTX))) {
+ for (i = 0; i < part->len / sizeof(uint32_t); i++) {
+ rctx = osmo_load32be(&part->dat[i * sizeof(uint32_t)]);
+ if (!osmo_ss7_as_find_by_rctx(asp->inst, rctx)) {
+ peer_send_error(fi, M3UA_ERR_INVAL_ROUT_CTX);
+ break;
+ }
}
}
/* send ACK */