Author: glen                         Date: Mon Jan 14 10:47:45 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- merged ipv6 patches

---- Files affected:
SOURCES:
   mod_rpaf_degtine.patch (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/mod_rpaf_degtine.patch
diff -u SOURCES/mod_rpaf_degtine.patch:1.2 SOURCES/mod_rpaf_degtine.patch:1.3
--- SOURCES/mod_rpaf_degtine.patch:1.2  Mon Jan 14 11:27:14 2008
+++ SOURCES/mod_rpaf_degtine.patch      Mon Jan 14 11:47:40 2008
@@ -1,5 +1,27 @@
---- mod_rpaf-0.6/mod_rpaf-2.0.c~       2008-01-14 12:22:30.000000000 +0200
-+++ mod_rpaf-0.6/mod_rpaf-2.0.c        2008-01-14 12:24:24.311847900 +0200
+--- mod_rpaf-0.5/mod_rpaf.c    2004-03-17 17:47:30.000000000 +0200
++++ mod_rpaf-0.5.ipv6/mod_rpaf.c       2006-01-05 18:18:09.000000000 +0200
+@@ -148,7 +148,18 @@
+                     ++fwdvalue;
+             }
+             r->connection->remote_ip = ap_pstrdup(r->connection->pool, ((char 
**)arr->elts)[((arr->nelts)-1)]);
+-            r->connection->remote_addr.sin_addr.s_addr = 
inet_addr(r->connection->remote_ip);
++                      switch (r->connection->remote_addr.ss_family) {
++                      case AF_INET:
++                              inet_pton(AF_INET, r->connection->remote_ip, 
&((struct sockaddr_in*)&r->connection->remote_addr)->sin_addr.s_addr);
++                              break;
++                      case AF_INET6:
++                              inet_pton(AF_INET6, r->connection->remote_ip, 
((struct sockaddr_in6*)&r->connection->remote_addr)->sin6_addr.s6_addr);
++                              break;
++                      default:
++                              ap_log_rerror(APLOG_MARK, 
APLOG_DEBUG|APLOG_NOERRNO, r, "Apache doesn't support this address family");
++                              break;
++                      }
++
+             if (cfg->sethostname) {
+                 const char *hostvalue;
+                 if (hostvalue = ap_table_get(r->headers_in, 
"X-Forwarded-Host")) {
+--- mod_rpaf-0.6/mod_rpaf-2.0.c~       2008-01-14 12:27:30.000000000 +0200
++++ mod_rpaf-0.6/mod_rpaf-2.0.c        2008-01-14 12:28:18.413347347 +0200
 @@ -130,6 +130,16 @@
      return 0;
  }
@@ -26,8 +48,8 @@
              r->connection->remote_addr->sa.sin.sin_addr.s_addr = 
apr_inet_addr(r->connection->remote_ip);
              if (cfg->sethostname) {
                  const char *hostvalue;
---- mod_rpaf-0.6/mod_rpaf.c~   2008-01-14 12:25:04.000000000 +0200
-+++ mod_rpaf-0.6/mod_rpaf.c    2008-01-14 12:25:28.975575680 +0200
+--- mod_rpaf-0.6/mod_rpaf.c~   2008-01-14 12:28:40.000000000 +0200
++++ mod_rpaf-0.6/mod_rpaf.c    2008-01-14 12:30:47.021926815 +0200
 @@ -130,6 +130,16 @@
      return 0;
  }
@@ -45,12 +67,59 @@
  static int change_remote_ip(request_rec *r) {
      const char *fwdvalue;
      char *val;
-@@ -192,7 +192,7 @@
+@@ -192,18 +192,7 @@
              rcr->old_ip = ap_pstrdup(r->connection->pool, 
r->connection->remote_ip);
              rcr->r = r;
              ap_register_cleanup(r->pool, (void *)rcr, rpaf_cleanup, 
ap_null_cleanup);
 -            r->connection->remote_ip = ap_pstrdup(r->connection->pool, ((char 
**)arr->elts)[((arr->nelts)-1)]);
+-                      switch (r->connection->remote_addr.ss_family) {
+-                      case AF_INET:
+-                              inet_pton(AF_INET, r->connection->remote_ip, 
&((struct sockaddr_in*)&r->connection->remote_addr)->sin_addr.s_addr);
+-                              break;
+-                      case AF_INET6:
+-                              inet_pton(AF_INET6, r->connection->remote_ip, 
((struct sockaddr_in6*)&r->connection->remote_addr)->sin6_addr.s6_addr);
+-                              break;
+-                      default:
+-                              ap_log_rerror(APLOG_MARK, 
APLOG_DEBUG|APLOG_NOERRNO, r, "Apache doesn't support this address family");
+-                              break;
+-                      }
 +            r->connection->remote_ip = ap_pstrdup(r->connection->pool, 
last_not_in_array(arr, cfg->proxy_ips));
-             r->connection->remote_addr.sin_addr.s_addr = 
inet_addr(r->connection->remote_ip);
+ 
+             if (cfg->sethostname) {
+                 const char *hostvalue;
+--- mod_rpaf-0.6/mod_rpaf.c~   2008-01-14 12:31:19.000000000 +0200
++++ mod_rpaf-0.6/mod_rpaf.c    2008-01-14 12:35:56.507787818 +0200
+@@ -148,7 +148,15 @@
+ static void rpaf_cleanup(void *data) {
+     rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)data;
+     rcr->r->connection->remote_ip   = ap_pstrdup(rcr->r->connection->pool, 
rcr->old_ip);
++#ifdef INET6
++      switch (rcr->r->connection->remote_addr.ss_family) {
++      case AF_INET:
++              inet_pton(AF_INET, rcr->r->connection->remote_ip, &((struct 
sockaddr_in*)&rcr->r->connection->remote_addr)->sin_addr.s_addr);
++              break;
++      }
++#else
+     rcr->r->connection->remote_addr.sin_addr.s_addr = 
inet_addr(rcr->r->connection->remote_ip);
++#endif
+ }
+ 
+ static char* last_not_in_array(array_header *forwarded_for,
+--- mod_rpaf-0.6/mod_rpaf.c~   2008-01-14 12:39:58.000000000 +0200
++++ mod_rpaf-0.6/mod_rpaf.c    2008-01-14 12:42:16.393702934 +0200
+@@ -201,6 +201,15 @@
+             rcr->r = r;
+             ap_register_cleanup(r->pool, (void *)rcr, rpaf_cleanup, 
ap_null_cleanup);
+             r->connection->remote_ip = ap_pstrdup(r->connection->pool, 
last_not_in_array(arr, cfg->proxy_ips));
++#ifdef INET6
++                      switch (r->connection->remote_addr.ss_family) {
++                      case AF_INET:
++                              inet_pton(AF_INET, r->connection->remote_ip, 
&((struct sockaddr_in*)&r->connection->remote_addr)->sin_addr.s_addr);
++                              break;
++                      }
++#else
++                      r->connection->remote_addr.sin_addr.s_addr = 
inet_addr(r->connection->remote_ip);
++#endif
+ 
              if (cfg->sethostname) {
                  const char *hostvalue;
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/mod_rpaf_degtine.patch?r1=1.2&r2=1.3&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to