make format_host non-reentrant by default
There are only three users which require it to be reentrant, the rest is
fine without. Instead, provide a reentrant format_host_r() for users
which need it.
Signed-off-by: Phil Sutter <phil@nwl.cc>
diff --git a/ip/link_iptnl.c b/ip/link_iptnl.c
index 04568ff..8411a6a 100644
--- a/ip/link_iptnl.c
+++ b/ip/link_iptnl.c
@@ -339,7 +339,7 @@
unsigned int addr = rta_getattr_u32(tb[IFLA_IPTUN_REMOTE]);
if (addr)
- remote = format_host(AF_INET, 4, &addr, s1, sizeof(s1));
+ remote = format_host(AF_INET, 4, &addr);
}
fprintf(f, "remote %s ", remote);
@@ -348,7 +348,7 @@
unsigned int addr = rta_getattr_u32(tb[IFLA_IPTUN_LOCAL]);
if (addr)
- local = format_host(AF_INET, 4, &addr, s1, sizeof(s1));
+ local = format_host(AF_INET, 4, &addr);
}
fprintf(f, "local %s ", local);
@@ -404,8 +404,7 @@
prefixlen);
if (relayprefix) {
printf("6rd-relay_prefix %s/%u ",
- format_host(AF_INET, 4, &relayprefix, s1,
- sizeof(s1)),
+ format_host(AF_INET, 4, &relayprefix),
relayprefixlen);
}
}