[Sumover-dev] [svn commit] r3862 - common/trunk/src
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Wed Sep 13 14:26:24 BST 2006
Author: piers
Date: Wed Sep 13 14:26:20 2006
New Revision: 3862
Modified:
common/trunk/src/rtp.c
Log:
A few changes:
1) Removed failure on use of non-even port number - as per RFC3550 - it spits out a debug message saying 'Should use even'.
2) Raised ttl minimum to 255 - it was originally 127 but it can be useful to set it higher. It seems a bit historical as the Global mbnone doesn't really exist to it's not going to hurt many people. It was just confusing.
3) *** Removed 'Speed over accuracy' check with based on wait_for rtcp option in validate_rtp() - It was leading to major problems when crypto was switched on - lots of packets were understandably getting thru the original basic RTP version number check resulting in nasty crashes.
Modified: common/trunk/src/rtp.c
==============================================================================
--- common/trunk/src/rtp.c (original)
+++ common/trunk/src/rtp.c Wed Sep 13 14:26:20 2006
@@ -1034,12 +1034,10 @@
return NULL;
}
if (rx_port % 2) {
- debug_msg("rx_port must be even\n");
- return NULL;
+ debug_msg("rx_port should be even\n");
}
if (tx_port % 2) {
- debug_msg("tx_port must be even\n");
- return NULL;
+ debug_msg("tx_port should be even\n");
}
session = (struct rtp *) xmalloc(sizeof(struct rtp));
@@ -1051,7 +1049,7 @@
session->addr = xstrdup(addr);
session->rx_port = rx_port;
session->tx_port = tx_port;
- session->ttl = min(ttl, 127);
+ session->ttl = min(ttl, 255);
session->rtp_socket = udp_init_if(addr, iface, rx_port, tx_port, ttl);
session->rtcp_socket = udp_init_if(addr, iface, (uint16_t) (rx_port+1), (uint16_t) (tx_port+1), ttl);
@@ -1288,14 +1286,15 @@
{
/* Check for valid payload types..... 72-76 are RTCP payload type numbers, with */
/* the high bit missing so we report that someone is running on the wrong port. */
- if (packet->fields.pt >= 72 && packet->fields.pt <= 76) {
+ if (packet->fields.pt >= 72 && packet->fields.pt <= 76) {
debug_msg("rtp_header_validation: payload-type invalid");
- if (packet->fields.m) {
- debug_msg(" (RTCP packet on RTP port?)");
+ if (packet->fields.m) {
+ debug_msg(" (RTCP packet on RTP port?)");
}
debug_msg("\n");
return FALSE;
}
+
/* Check that the length of the packet is sensible... */
if (len < (12 + (4 * packet->fields.cc))) {
debug_msg("rtp_header_validation: packet length is smaller than the header\n");
@@ -1334,10 +1333,6 @@
return FALSE;
}
- if (!session->opt->wait_for_rtcp) {
- /* We prefer speed over accuracy... */
- return TRUE;
- }
return validate_rtp2(packet, len);
}
More information about the Sumover-dev
mailing list