aboutsummaryrefslogtreecommitdiff
path: root/networking/httpd.c
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-09-25 11:58:33 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-09-25 11:58:33 +0000
commit35465a3f005b99e25cea3cfa42a9de348976be8a (patch)
treed22781e58b6313018f3153661fec1c886050a52c /networking/httpd.c
parentd9391b15f166cfc016f5768c8d6a89858e0d7e41 (diff)
downloadbusybox-35465a3f005b99e25cea3cfa42a9de348976be8a.tar.gz
busybox-35465a3f005b99e25cea3cfa42a9de348976be8a.tar.bz2
httpd: small auth and IPv6 fixes (Kim B. Heino <Kim.Heino@bluegiga.com>)
Diffstat (limited to 'networking/httpd.c')
-rw-r--r--networking/httpd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 33f083189..cedec800f 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -628,7 +628,7 @@ static void parse_conf(const char *path, int flag)
++p; /* so keep last character */
}
*p = '\0';
- sprintf(p0, "%s:%s", p0, c);
+ sprintf(p0 + strlen(p0), ":%s", c);
}
#endif
@@ -1688,6 +1688,13 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
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);
}