]>
Commit | Line | Data |
---|---|---|
6ce260df AM |
1 | commit a4b3e41e5fb845e0804ff6a5a4e94b5b0631b6b7 |
2 | Merge: 319268f e939025 | |
3 | Author: Geoffrey McRae <gnif@users.noreply.github.com> | |
4 | Date: Tue Dec 20 14:19:54 2016 +1100 | |
5 | ||
6 | Merge pull request #46 from criecm/stable | |
7 | ||
8 | Fix warning with clang | |
9 | ||
10 | commit e93902533dd89ba6c77cea90e4e2c7d762650126 | |
11 | Author: Geoffroy Desvernay <dgeo@centrale-marseille.fr> | |
12 | Date: Mon Dec 12 10:01:14 2016 +0100 | |
13 | ||
14 | Fix warning with clang | |
15 | ||
16 | Fix this warning on FreeBSD 11 (clang cc by default) | |
17 | ./apxs.sh -c -n mod_rpaf.so mod_rpaf.c | |
18 | /usr/local/share/apr/build-1/libtool --silent --mode=compile cc -prefer-pic -O2 -pipe -I/usr/local/include -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -I/usr/local/include/apache24 -I/usr/local/include/apr-1 -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/local/include/db5 -I/usr/include -c -o mod_rpaf.lo mod_rpaf.c && touch mod_rpaf.slo | |
19 | mod_rpaf.c:117:18: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] | |
20 | if (mask = ap_strchr(ip, '/')) { | |
21 | ~~~~~^~~~~~~~~~~~~~~~~~~~ | |
22 | mod_rpaf.c:117:18: note: place parentheses around the assignment to silence this warning | |
23 | if (mask = ap_strchr(ip, '/')) { | |
24 | ^ | |
25 | ( ) | |
26 | mod_rpaf.c:117:18: note: use '==' to turn this assignment into an equality comparison | |
27 | if (mask = ap_strchr(ip, '/')) { | |
28 | ^ | |
29 | == | |
30 | 1 warning generated. | |
31 | ||
32 | diff --git a/mod_rpaf.c b/mod_rpaf.c | |
33 | index ee59765..519aece 100644 | |
34 | --- a/mod_rpaf.c | |
35 | +++ b/mod_rpaf.c | |
36 | @@ -114,7 +114,7 @@ static const char *rpaf_set_proxy_ip(cmd_parms *cmd, void *dummy, const char *pr | |
37 | ||
38 | if (rpaf_looks_like_ip(proxy_ip)) { | |
39 | ip = apr_pstrdup(cmd->temp_pool, proxy_ip); | |
40 | - if (mask = ap_strchr(ip, '/')) { | |
41 | + if ((mask = ap_strchr(ip, '/'))) { | |
42 | *mask++ = '\0'; | |
43 | } | |
44 | sub = (apr_ipsubnet_t **)apr_array_push(cfg->proxy_ips); | |
45 | ||
46 | commit 6ecaee817d787db3c449d07282e1c440e5dccaeb | |
47 | Author: Ben Sjoberg <bensjoberg@gmail.com> | |
48 | Date: Fri Dec 9 21:05:38 2016 -0600 | |
49 | ||
50 | Fix IPv6 client IPs when the proxy uses KeepAlive | |
51 | ||
52 | diff --git a/mod_rpaf.c b/mod_rpaf.c | |
53 | index ee59765..e4d8ae7 100644 | |
54 | --- a/mod_rpaf.c | |
55 | +++ b/mod_rpaf.c | |
56 | @@ -54,6 +54,7 @@ typedef struct { | |
57 | ||
58 | typedef struct { | |
59 | const char *old_ip; | |
60 | + apr_sockaddr_t old_addr; | |
61 | request_rec *r; | |
62 | } rpaf_cleanup_rec; | |
63 | ||
64 | @@ -206,7 +207,7 @@ static int is_in_array(apr_sockaddr_t *remote_addr, apr_array_header_t *proxy_ip | |
65 | static apr_status_t rpaf_cleanup(void *data) { | |
66 | rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)data; | |
67 | rcr->r->DEF_IP = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip); | |
68 | - rcr->r->DEF_ADDR->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->DEF_IP); | |
69 | + memcpy(rcr->r->DEF_ADDR, &rcr->old_addr, sizeof(apr_sockaddr_t)); | |
70 | return APR_SUCCESS; | |
71 | } | |
72 | ||
73 | @@ -311,6 +312,7 @@ static int rpaf_post_read_request(request_rec *r) { | |
74 | rcr->r = r; | |
75 | apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null); | |
76 | r->DEF_IP = apr_pstrdup(r->DEF_POOL, last_val); | |
77 | + memcpy(&rcr->old_addr, r->DEF_ADDR, sizeof(apr_sockaddr_t)); | |
78 | ||
79 | tmppool = r->DEF_ADDR->pool; | |
80 | tmpport = r->DEF_ADDR->port; | |
81 | ||
82 | commit 5d3cd725c118c0b5f3a330b618d723cc99b77065 | |
83 | Author: Geoffrey McRae <geoff@spacevs.com> | |
84 | Date: Wed Oct 14 00:32:47 2015 +1100 | |
85 | ||
86 | Added '.' to the ipv6 character set for ipv4 in ipv6 addresses, fixes #19 | |
87 | ||
88 | diff --git a/mod_rpaf.c b/mod_rpaf.c | |
89 | index 7425aa6..690f0f9 100644 | |
90 | --- a/mod_rpaf.c | |
91 | +++ b/mod_rpaf.c | |
92 | @@ -81,7 +81,7 @@ static void *rpaf_create_server_cfg(apr_pool_t *p, server_rec *s) { | |
93 | /* quick check for ipv4/6 likelihood; similar to Apache2.4 mod_remoteip check */ | |
94 | static int rpaf_looks_like_ip(const char *ip) { | |
95 | static const char ipv4_set[] = "0123456789./"; | |
96 | - static const char ipv6_set[] = "0123456789abcdef:/"; | |
97 | + static const char ipv6_set[] = "0123456789abcdef:/."; | |
98 | ||
99 | /* zero length value is not valid */ | |
100 | if (!*ip) | |
101 | ||
102 |