File: 030_ipv6.patch

package info (click to toggle)
libapache2-mod-rpaf 0.6-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 228 kB
  • sloc: ansic: 317; perl: 122; makefile: 52; sh: 19
file content (31 lines) | stat: -rw-r--r-- 1,265 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: ipv6 fixes
Author: Piotr Roszatycki <dexter@debian.org>
Reviewed-by: Sergey B Kirpichev <skirpichev@gmail.com>
Bug-Debian: http://bugs.debian.org/726529

---
 mod_rpaf-2.0.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/mod_rpaf-2.0.c
+++ b/mod_rpaf-2.0.c
@@ -72,6 +72,8 @@
 #include "http_vhost.h"
 #include "apr_strings.h"
 
+#include <arpa/inet.h>
+
 module AP_MODULE_DECLARE_DATA rpaf_module;
 
 typedef struct {
@@ -185,6 +187,10 @@
             apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null);
             r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]);
             r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip);
+            apr_sockaddr_t *tmpsa;
+            int ret = apr_sockaddr_info_get(&tmpsa, r->connection->remote_ip, APR_UNSPEC, r->connection->remote_addr->port, 0, r->connection->remote_addr->pool);
+            if (ret == APR_SUCCESS)
+                memcpy(r->connection->remote_addr, tmpsa, sizeof(apr_sockaddr_t));
             if (cfg->sethostname) {
                 const char *hostvalue;
                 if (hostvalue = apr_table_get(r->headers_in, "X-Forwarded-Host")) {