aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-12 14:01:45 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-12 14:01:47 +0200
commitcad739d2386640a68c24e3d470ddacdcaf377561 (patch)
treebf075aeedd6e32ca63f07fa79ae2b58538d0a6a9
parent60ccddec0a12f0857e611c4c85ff26e347c6b0a0 (diff)
mgcp: Avoid initing output without enabling osmux
Otherwise we end up in a weird state where we have timers set up but osmux is still flagged as not enabled. Change-Id: I15c3a1a6bdf2566b03d1d543d8d15e4117a53622
-rw-r--r--openbsc/src/libmgcp/mgcp_osmux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index 69f1c66b5..0a4441c61 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -447,10 +447,6 @@ int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint
return -1;
}
- osmux_xfrm_output_init(&endp->osmux.out,
- (endp->osmux.cid * rtp_ssrc_winlen) +
- (random() % rtp_ssrc_winlen));
-
endp->osmux.in = osmux_handle_lookup(endp->cfg, addr, port);
if (!endp->osmux.in) {
LOGP(DMGCP, LOGL_ERROR, "Cannot allocate input osmux handle\n");
@@ -463,6 +459,10 @@ int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint
return -1;
}
+ osmux_xfrm_output_init(&endp->osmux.out,
+ (endp->osmux.cid * rtp_ssrc_winlen) +
+ (random() % rtp_ssrc_winlen));
+
switch (endp->cfg->role) {
case MGCP_BSC_NAT:
endp->type = MGCP_OSMUX_BSC_NAT;