]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
config: Styling fix + use fmt_addr()
authorc <c@chroniko.jp>
Thu, 4 Jun 2020 13:15:27 +0000 (13:15 +0000)
committerc <c@chroniko.jp>
Thu, 4 Jun 2020 13:15:27 +0000 (13:15 +0000)
Conform to C99 as suggested by nickm on #32888 and use fmt_addr() rather
than tor_addr_to_str_dup()

src/lib/net/address.c

index 0571f48a3005db0e080a10c48b47446a19af841e..b09c9115c4eef13e46acb13d64b7994e910a0a8a 100644 (file)
@@ -1693,16 +1693,12 @@ get_interface_address6,(int severity, sa_family_t family, tor_addr_t *addr))
   /* Find the first non-internal address, or the last internal address
    * Ideally, we want the default route, see #12377 for details */
   SMARTLIST_FOREACH_BEGIN(addrs, tor_addr_t *, a) {
-    char *addr_str;
-    int is_internal;
     tor_addr_copy(addr, a);
-    is_internal = tor_addr_is_internal(a, 0);
+    const bool is_internal = tor_addr_is_internal(a, 0);
     rv = 0;
 
-    addr_str = tor_addr_to_str_dup(addr);
     log_debug(LD_NET, "Found %s interface address '%s'",
-              (is_internal ? "internal" : "external"), addr_str);
-    tor_free(addr_str);
+              (is_internal ? "internal" : "external"), fmt_addr(addr));
 
     /* If we found a non-internal address, declare success.  Otherwise,
      * keep looking. */