summaryrefslogtreecommitdiffstats
path: root/openbsc/src/mgcp/mgcp_network.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-06 11:15:50 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-06 12:12:52 +0200
commit7279d24232d000697297b1ad50da4cf012da2418 (patch)
tree9417f536310fdb7d1f50a9974501e10e8b86a59a /openbsc/src/mgcp/mgcp_network.c
parentef8253c495417ed3756440b4479651389be75db8 (diff)
[mgcp] Do not patch RTP payload when type is set to -1.
For the nat we might or might not want to patch it, do not patch if we have no valid rtp payload type.
Diffstat (limited to 'openbsc/src/mgcp/mgcp_network.c')
-rw-r--r--openbsc/src/mgcp/mgcp_network.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c
index 592e20fff..9e18937d1 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;
}