aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-05 10:47:40 +0000
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-05 19:35:44 +0800
commitb97c50db0af26f9b047aaf0e74c55b64a62633f6 (patch)
tree91d19d9dd8a317eaa112defd5c7a43fa86fafb35
parentd5e6c2374b3c20ed5bc2eaf12c0038633f8b27c8 (diff)
mgcp: Only discover the bts once, the extra check got lost
-rw-r--r--openbsc/src/mgcp/mgcp_network.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c
index ea95c618..f298ebbf 100644
--- a/openbsc/src/mgcp/mgcp_network.c
+++ b/openbsc/src/mgcp/mgcp_network.c
@@ -271,9 +271,9 @@ static int rtp_data_bts(struct bsc_fd *fd, unsigned int what)
/* We have no idea who called us, maybe it is the BTS. */
/* it was the BTS... */
- if (!cfg->bts_ip
- || memcmp(&addr.sin_addr, &cfg->bts_in, sizeof(cfg->bts_in)) == 0
- || memcmp(&addr.sin_addr, &endp->bts_end.addr, sizeof(endp->bts_end.addr)) == 0) {
+ if (endp->bts_end.rtp_port == 0 && (!cfg->bts_ip
+ || memcmp(&addr.sin_addr, &cfg->bts_in, sizeof(cfg->bts_in)) == 0
+ || memcmp(&addr.sin_addr, &endp->bts_end.addr, sizeof(endp->bts_end.addr)) == 0)) {
if (proto == PROTO_RTP)
endp->bts_end.rtp_port = addr.sin_port;
else