aboutsummaryrefslogtreecommitdiffstats
path: root/rtp.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-03-31 19:09:48 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-03-31 19:09:48 +0000
commitfcd98001def35d05712725745ff45ee479f045a7 (patch)
tree2745b60b932c6fe3a71c4aef30eedd25657a22c4 /rtp.c
parente4628c8ed23ab1b7ce305c2c07cde28f2ce52eec (diff)
Fix RTP checksums config option (bug #3908 with minor mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5322 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/rtp.c b/rtp.c
index d5c6b99bc..cfcfc1c3d 100755
--- a/rtp.c
+++ b/rtp.c
@@ -56,7 +56,7 @@ static int rtpend = 0;
static int rtpdebug = 0; /* Are we debugging? */
static struct sockaddr_in rtpdebugaddr; /* Debug packets to/from this host */
#ifdef SO_NO_CHECK
-static int checksums = 1;
+static int nochecksums = 0;
#endif
/* The value of each payload format mapping: */
@@ -857,9 +857,8 @@ static int rtp_socket(void)
flags = fcntl(s, F_GETFL);
fcntl(s, F_SETFL, flags | O_NONBLOCK);
#ifdef SO_NO_CHECK
- if (checksums) {
- setsockopt(s, SOL_SOCKET, SO_NO_CHECK, &checksums, sizeof(checksums));
- }
+ if (nochecksums)
+ setsockopt(s, SOL_SOCKET, SO_NO_CHECK, &nochecksums, sizeof(nochecksums));
#endif
}
return s;
@@ -1743,9 +1742,6 @@ void ast_rtp_reload(void)
rtpstart = 5000;
rtpend = 31000;
-#ifdef SO_NO_CHECK
- checksums = 1;
-#endif
cfg = ast_config_load("rtp.conf");
if (cfg) {
if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
@@ -1764,12 +1760,12 @@ void ast_rtp_reload(void)
}
if ((s = ast_variable_retrieve(cfg, "general", "rtpchecksums"))) {
#ifdef SO_NO_CHECK
- if (ast_true(s))
- checksums = 1;
+ if (ast_false(s))
+ nochecksums = 1;
else
- checksums = 0;
+ nochecksums = 0;
#else
- if (ast_true(s))
+ if (ast_false(s))
ast_log(LOG_WARNING, "Disabling RTP checksums is not supported on this operating system!\n");
#endif
}