mod_rpaf icon indicating copy to clipboard operation
mod_rpaf copied to clipboard

IPv6 client IP not updated when using KeepAlive

Open jonmz opened this issue 9 years ago • 7 comments

Currently using the "stable" tree we were facing the problem that only the first request has the real client IP correctly transferred into REMOTE_ADDR when using KeepAlive. Further requests received the unchanged proxy IP, until the KeepAlive timeout value has been reached.

After stumbling upon Issue #35 we changed from "stable" to the current "master" tree, which effectively fixed the problem - but, amazingly, only for IPv4 addresses: IPv6 addresses still only got correctly set on every first request ever or after reaching the KeepAlive timeout. We're testing with the following PHP script:

<?php
echo $_SERVER['REMOTE_ADDR'];
echo "<br>";
echo $_SERVER['HTTP_X_FORWARDED_FOR'];
?>

Result on the first request is (correctly):

2001:470:1f0b:c02:888e:911b:c753:38a0
2001:470:1f0b:c02:888e:911b:c753:38a0

Result on every next request within the KeepAlive timeout results in (185.26.156.43 is the proxy IP listed as RPAF_ProxyIPs):

185.26.156.43
2001:470:1f0b:c02:888e:911b:c753:38a0

As a workaround we're currently having to turn off KeepAlive; in this case mod_rpaf provides correct results for both IPv4 and IPv6. Is there any chance to fix this?

jonmz avatar Dec 30 '15 14:12 jonmz

Check 71a17f2fccc739d132631ee19952b0ab2b366018 and see #35 for a similar report.

mpdude avatar Dec 31 '15 10:12 mpdude

I already did that; see my second paragraph. By switching from stable to master, 71a17f2fccc739d132631ee19952b0ab2b366018 is included in my source and fixed the problem for IPv4 IPs. It did not fix the problem for IPv6 IPs, thus this issue.

jonmz avatar Dec 31 '15 10:12 jonmz

Oh, sorry, missed that!

mpdude avatar Dec 31 '15 10:12 mpdude

Explanation and proposed fix in #45. :)

BenSjoberg avatar Dec 10 '16 03:12 BenSjoberg

This issue may have been fixed with @BenSjoberg patch which has now been merged, can you please confirm if you are still experiencing the issue still?

gnif avatar Dec 20 '16 03:12 gnif

Would this fix have any impact on #42 ?

AndreiG6 avatar Dec 29 '16 09:12 AndreiG6