We are going to have addresses of multiple address families in various
places, which will mean more calls to iaddr_to_string for the benefit
of the same logging statement.
Increase the number of static buffers used by iaddr_to_string from 2
to 8.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
+#define IADDR_NBUFS_SHIFT 3
+#define IADDR_NBUFS (1 << IADDR_NBUFS_SHIFT)
+
const char *iaddr_to_string(const union iaddr *ia)
{
const char *iaddr_to_string(const union iaddr *ia)
{
- static char bufs[2][100];
+ static char bufs[IADDR_NBUFS][100];
+ b++;
+ b &= IADDR_NBUFS-1;
assert(ia->sa.sa_family == AF_INET);
assert(ia->sa.sa_family == AF_INET);