Browse Source

Compare address family in inet_ntop_cache

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2353 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.21
Stefan Bühler 13 years ago
parent
commit
bcf2b160cf
  1. 1
      NEWS
  2. 2
      src/inet_ntop_cache.c

1
NEWS

@ -19,6 +19,7 @@ NEWS
* Fix duplicate connection keep-alive/transfer-encoding headers (#960)
* Fixed fix for round-robin in mod_proxy (forgot to increment the index) (#1715)
* Fix fastcgi-authorizer handling; Status: 200 is now accepted as the doc requests
* Compare address family in inet_ntop_cache
- 1.4.20 - 2008-09-30

2
src/inet_ntop_cache.c

@ -11,7 +11,7 @@ const char * inet_ntop_cache_get_ip(server *srv, sock_addr *addr) {
#ifdef HAVE_IPV6
size_t ndx = 0, i;
for (i = 0; i < INET_NTOP_CACHE_MAX; i++) {
if (srv->inet_ntop_cache[i].ts != 0) {
if (srv->inet_ntop_cache[i].ts != 0 && srv->inet_ntop_cache[i].family == addr->plain.sa_family) {
if (srv->inet_ntop_cache[i].family == AF_INET6 &&
0 == memcmp(srv->inet_ntop_cache[i].addr.ipv6.s6_addr, addr->ipv6.sin6_addr.s6_addr, 16)) {
/* IPv6 found in cache */

Loading…
Cancel
Save