]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core] Fix ICE candidate priorities 875/head
authorAlexander Traud <pabstraud@compuserve.com>
Sun, 27 Sep 2020 11:04:31 +0000 (13:04 +0200)
committerGitHub <noreply@github.com>
Sun, 27 Sep 2020 11:04:31 +0000 (13:04 +0200)
Seven years ago, commit cb076e6 used xor as pow. The compiler Clang 10
errors about this copy-paste-error from RFC 5245 section 4.1.2.1. Now,
Clang compiles successfully.

src/switch_core_media.c

index 45468bfb007e639ca8e49d51157c820500cff749..e0416e07684f4f9dd5ee0c5b9a07734ed7980a4a 100644 (file)
@@ -8425,7 +8425,7 @@ static void gen_ice(switch_core_session_t *session, switch_media_type_t type, co
 
        if (!engine->ice_out.cands[0][0].component_id) {
                engine->ice_out.cands[0][0].component_id = 1;
-               engine->ice_out.cands[0][0].priority = (2^24)*126 + (2^8)*65535 + (2^0)*(256 - engine->ice_out.cands[0][0].component_id);
+               engine->ice_out.cands[0][0].priority = (1<<24)*126 + (1<<8)*65535 + (1<<0)*(256 - engine->ice_out.cands[0][0].component_id);
        }
 
        if (!zstr(ip)) {
@@ -9921,12 +9921,8 @@ static void generate_m(switch_core_session_t *session, char *buf, size_t buflen,
                char tmp1[11] = "";
                char tmp2[11] = "";
                char tmp3[11] = "";
-               uint32_t c1 = (2^24)*126 + (2^8)*65535 + (2^0)*(256 - 1);
+               uint32_t c1 = (1<<24)*126 + (1<<8)*65535 + (1<<0)*(256 - 1);
                uint32_t c2 = c1 - 1;
-
-               //uint32_t c2 = (2^24)*126 + (2^8)*65535 + (2^0)*(256 - 2);
-               //uint32_t c3 = (2^24)*126 + (2^8)*65534 + (2^0)*(256 - 1);
-               //uint32_t c4 = (2^24)*126 + (2^8)*65534 + (2^0)*(256 - 2);
                ice_t *ice_out;
 
                tmp1[10] = '\0';
@@ -10673,11 +10669,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
                        char tmp1[11] = "";
                        char tmp2[11] = "";
                        char tmp3[11] = "";
-                       uint32_t c1 = (2^24)*126 + (2^8)*65535 + (2^0)*(256 - 1);
-                       //uint32_t c2 = (2^24)*126 + (2^8)*65535 + (2^0)*(256 - 2);
-                       //uint32_t c3 = (2^24)*126 + (2^8)*65534 + (2^0)*(256 - 1);
-                       //uint32_t c4 = (2^24)*126 + (2^8)*65534 + (2^0)*(256 - 2);
-
+                       uint32_t c1 = (1<<24)*126 + (1<<8)*65535 + (1<<0)*(256 - 1);
                        uint32_t c2 = c1 - 1;
                        uint32_t c3 = c1 - 2;
                        uint32_t c4 = c1 - 3;
@@ -11215,11 +11207,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
                                        char tmp1[11] = "";
                                        char tmp2[11] = "";
                                        char tmp3[11] = "";
-                                       uint32_t c1 = (2^24)*126 + (2^8)*65535 + (2^0)*(256 - 1);
-                                       //uint32_t c2 = (2^24)*126 + (2^8)*65535 + (2^0)*(256 - 2);
-                                       //uint32_t c3 = (2^24)*126 + (2^8)*65534 + (2^0)*(256 - 1);
-                                       //uint32_t c4 = (2^24)*126 + (2^8)*65534 + (2^0)*(256 - 2);
-
+                                       uint32_t c1 = (1<<24)*126 + (1<<8)*65535 + (1<<0)*(256 - 1);
                                        uint32_t c2 = c1 - 1;
                                        uint32_t c3 = c1 - 2;
                                        uint32_t c4 = c1 - 3;
@@ -11584,11 +11572,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
                                if (t_engine->ice_out.cands[0][0].ready) {
                                        char tmp1[11] = "";
                                        char tmp2[11] = "";
-                                       uint32_t c1 = (2^24)*126 + (2^8)*65535 + (2^0)*(256 - 1);
-                                       //uint32_t c2 = (2^24)*126 + (2^8)*65535 + (2^0)*(256 - 2);
-                                       //uint32_t c3 = (2^24)*126 + (2^8)*65534 + (2^0)*(256 - 1);
-                                       //uint32_t c4 = (2^24)*126 + (2^8)*65534 + (2^0)*(256 - 2);
-
+                                       uint32_t c1 = (1<<24)*126 + (1<<8)*65535 + (1<<0)*(256 - 1);
                                        uint32_t c2 = c1 - 1;
                                        uint32_t c3 = c1 - 2;
                                        uint32_t c4 = c1 - 3;