]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Removed an autological-pointer-compare from src/switch_utils.c.
authorKathleen King <kathleen.king@quentustech.com>
Thu, 3 Jul 2014 19:12:22 +0000 (12:12 -0700)
committerKathleen King <kathleen.king@quentustech.com>
Thu, 3 Jul 2014 19:12:22 +0000 (12:12 -0700)
Building with Clang 3.5 gave the following warning: error: comparison
of array 'iface_out.sin6_addr.__in6_u.__u6_addr8' equal to a null
pointer is always false [-Werror,-Wtautological-pointer-compare]

This is a problem because as it is written the check will never be
true. A pointer to a structure within a structure will never be null. The
intention was either to null check the pointer or to check if the IP
address itself was not zero.

From context in the code this appeared to be a pointer null check so I
removed it.

src/switch_utils.c

index a5c4b8f2f74d19d2e5ba68b2e93ffc7948a55976..da0373098d2ec71b52621697ad53da9ddee68737 100644 (file)
@@ -1560,10 +1560,6 @@ SWITCH_DECLARE(switch_status_t) switch_find_local_ip(char *buf, int len, int *ma
                                goto doh;
                        }
 
-                       if (iface_out.sin6_addr.s6_addr == 0) {
-                               goto doh;
-                       }
-
                        inet_ntop(AF_INET6, (const void *) &iface_out.sin6_addr, buf, len - 1);
                        status = SWITCH_STATUS_SUCCESS;
                }