[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    httpd and ipv6
From:       "Kim B. Heino" <Kim.Heino () bluegiga ! com>
Date:       2007-09-25 7:58:18
Message-ID: 46F8BF9A.4070205 () bluegiga ! com
[Download RAW message or body]

If I have IPv6 enabled, httpd's deny/allow config does not work. This 
patch does NOT add full IPv6 support, but instead adds a quick'n'dirty 
IPv6 to IPv4 converter. For my basic usage this is enough.

["busybox-httpd_ipv6.patch" (text/x-patch)]

--- f/networking/httpd.c	2007-09-25 10:01:28.000000000 +0300
+++ busybox-1.7.1/networking/httpd.c	2007-09-25 10:41:18.000000000 +0300
@@ -1602,6 +1602,13 @@
 	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);
 	}


_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic