]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_rtp_asterisk: Fix a self-comparison identified by gcc 6 23/3123/2
authorGeorge Joseph <gjoseph@digium.com>
Wed, 22 Jun 2016 18:41:57 +0000 (12:41 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 30 Jun 2016 20:05:31 +0000 (15:05 -0500)
gcc 6 caught a previously unidentified self-comparison in
ice_candidate_cmp.  Fixed it and re-ordered the predicates for better
short-circuiting.

ASTERISK-26140 #close

Change-Id: I3da713c568e24064430257b3502fbdafd35af7a7

res/res_rtp_asterisk.c

index 611920e807ce1937c94a9c1512bc420b772a7099..35ef37d7df0d8ef0bf2c1eaa76855b52b104c1ad 100644 (file)
@@ -540,8 +540,8 @@ static int ice_candidate_cmp(void *obj, void *arg, int flags)
 
        if (strcmp(candidate1->foundation, candidate2->foundation) ||
                        candidate1->id != candidate2->id ||
-                       ast_sockaddr_cmp(&candidate1->address, &candidate2->address) ||
-                       candidate1->type != candidate1->type) {
+                       candidate1->type != candidate2->type ||
+                       ast_sockaddr_cmp(&candidate1->address, &candidate2->address)) {
                return 0;
        }