diff options
Diffstat (limited to 'openbsc/src/mgcp/mgcp_network.c')
-rw-r--r-- | openbsc/src/mgcp/mgcp_network.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c index b76ca4732..6cc6e9d70 100644 --- a/openbsc/src/mgcp/mgcp_network.c +++ b/openbsc/src/mgcp/mgcp_network.c @@ -90,6 +90,9 @@ static void patch_payload(int payload, char *data, int len) if (len < sizeof(*rtp_hdr)) return; + if (payload < 0) + return; + rtp_hdr = (struct rtp_hdr *) data; rtp_hdr->payload_type = payload; } @@ -126,7 +129,7 @@ static int rtp_data_cb(struct bsc_fd *fd, unsigned int what) /* do not forward aynthing... maybe there is a packet from the bts */ if (endp->ci == CI_UNUSED) { - LOGP(DMGCP, LOGL_ERROR, "Unknown message on endpoint: 0x%x\n", ENDPOINT_NUMBER(endp)); + LOGP(DMGCP, LOGL_DEBUG, "Unknown message on endpoint: 0x%x\n", ENDPOINT_NUMBER(endp)); return -1; } @@ -146,7 +149,9 @@ static int rtp_data_cb(struct bsc_fd *fd, unsigned int what) /* We have no idea who called us, maybe it is the BTS. */ if (dest == DEST_NETWORK && (endp->bts_rtp == 0 || cfg->forward_ip)) { /* it was the BTS... */ - if (!cfg->bts_ip || memcmp(&addr.sin_addr, &cfg->bts_in, sizeof(cfg->bts_in)) == 0) { + if (!cfg->bts_ip + || memcmp(&addr.sin_addr, &cfg->bts_in, sizeof(cfg->bts_in)) == 0 + || memcmp(&addr.sin_addr, &endp->bts, sizeof(endp->bts)) == 0) { if (fd == &endp->local_rtp) { endp->bts_rtp = addr.sin_port; } else { |