[MINOR] make use of set_host_port() and get_host_port() to get rid of family mismatches
This also simplifies the code and makes it more auditable.
diff --git a/src/log.c b/src/log.c
index 02b6b20..16ace2f 100644
--- a/src/log.c
+++ b/src/log.c
@@ -356,9 +356,7 @@
" %s %s/%s %ld/%ld/%s%ld %s%lld"
" %c%c %d/%d/%d/%d/%s%u %ld/%ld\n",
s->si[0].addr.c.from.ss_family == AF_UNIX ? "unix" : pn,
- s->si[0].addr.c.from.ss_family == AF_UNIX ? s->listener->luid : (ntohs((s->si[0].addr.c.from.ss_family == AF_INET) ?
- ((struct sockaddr_in *)&s->si[0].addr.c.from)->sin_port :
- ((struct sockaddr_in6 *)&s->si[0].addr.c.from)->sin6_port)),
+ s->si[0].addr.c.from.ss_family == AF_UNIX ? s->listener->luid : get_host_port(&s->si[0].addr.c.from),
tm.tm_mday, monthname[tm.tm_mon], tm.tm_year+1900,
tm.tm_hour, tm.tm_min, tm.tm_sec, (int)s->logs.tv_accept.tv_usec/1000,
fe->id, be->id, svid,