]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix rtpchecksums option (bug #3908)
authorRussell Bryant <russell@russellbryant.com>
Tue, 5 Apr 2005 06:53:14 +0000 (06:53 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 5 Apr 2005 06:53:14 +0000 (06:53 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5397 65c4cc65-6c06-0410-ace0-fbb531ad65f3

CHANGES
rtp.c

diff --git a/CHANGES b/CHANGES
index 1bb2c48681af143e259d73fcbc24151bb65cff05..54a5a2e901da7bf731f25d2ca4f6fa60ace2bcbd 100755 (executable)
--- a/CHANGES
+++ b/CHANGES
@@ -25,7 +25,7 @@
     -- Fixed if the last line of text in a file for the call spool did not contain
        a new line, it would not be processed
     -- Fixed the logger so that color escape sequences wouldn't be sent to the logs
-
+    -- Fixed a logic error when setting the "rtpchecksums" option
 Asterisk 1.0.7
 
  -- chan_sip
diff --git a/rtp.c b/rtp.c
index b21d7dbac71d35ed0dfe7763649db9a7342290b9..35941edfd4ccb9cfaf808e47482c28f7f2c10292 100755 (executable)
--- a/rtp.c
+++ b/rtp.c
@@ -53,7 +53,7 @@ static int dtmftimeout = 3000;        /* 3000 samples */
 static int rtpstart = 0;
 static int rtpend = 0;
 #ifdef SO_NO_CHECK
-static int checksums = 1;
+static int nochecksums = 0;
 #endif
 
 /* The value of each payload format mapping: */
@@ -803,9 +803,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;
@@ -1540,9 +1539,6 @@ void ast_rtp_reload(void)
        char *s;
        rtpstart = 5000;
        rtpend = 31000;
-#ifdef SO_NO_CHECK
-       checksums = 1;
-#endif
        cfg = ast_load("rtp.conf");
        if (cfg) {
                if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
@@ -1561,12 +1557,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
                }