++p; /* so keep last character */
}
*p = '\0';
- sprintf(p0, "%s:%s", p0, c);
+ sprintf(p0 + strlen(p0), ":%s", c);
}
#endif
if (fromAddr->sa.sa_family == AF_INET) {
rmt_ip = ntohl(fromAddr->sin.sin_addr.s_addr);
}
+#if ENABLE_FEATURE_IPV6
+ if (fromAddr->sa.sa_family == AF_INET6
+ && fromAddr->sin6.sin6_addr.s6_addr32[0] == 0
+ && fromAddr->sin6.sin6_addr.s6_addr32[1] == 0
+ && ntohl(fromAddr->sin6.sin6_addr.s6_addr32[2]) == 0xffff)
+ rmt_ip = ntohl(fromAddr->sin6.sin6_addr.s6_addr32[3]);
+#endif
if (ENABLE_FEATURE_HTTPD_CGI || DEBUG || verbose) {
rmt_ip_str = xmalloc_sockaddr2dotted(&fromAddr->sa);
}