Feature #2706
closedMatching IPv6 addresses with $HTTP["remoteip"]
Description
$HTTP["remoteip"] doesn't match on IPv6 addresses.
It may also be useful for it to match v6-mapped IPv4 addresses.
I supplied a patch to do both in #385, but was asked to open a new bug.
I understand that the preferred configuration is to use bindv6only
, but some installments (not mine) may be stuck with v6-mapped addresses so silently matching them with dotted-quad addresses may come handy to those people.
The attached patch lacks MS-Windows support.
Files
Updated by gstrauss over 8 years ago
Read through patch and it looks sane to me.
@ef, would you consider writing a few tests in tests/*.t to validate the patch? Thanks.
Updated by stbuehler over 8 years ago
- Related to Bug #385: Enabling ipv6 makes matching subnets with $HTTP["remoteip"] inoperable. added
Updated by gstrauss over 8 years ago
@ef: would you consider writing a few tests in tests/*.t to validate the patch? Thanks.
Updated by ef over 8 years ago
gstrauss wrote:
would you consider writing a few tests in tests/*.t to validate the patch?
I may consider that, but I'm neither familiar with lighttpd's test framework nor will I have time left to do that anytime soon, sorry.
Updated by gstrauss over 8 years ago
- Tracker changed from Bug to Feature
The attached patch lacks MS-Windows support.
Would you provide a link or two, or a quick explanation why? Thx.
Updated by ef over 8 years ago
gstrauss wrote:
Would you provide a link or two
I don't understand. A link to what?
or a quick explanation why?
Because I don't know how to write that support.
There's an #ifdef __WIN32
in the code and the true branch uses some inet_addr()
function (while the false branch used inet_aton()
and now uses inet_pton()
).
I have no idea how to parse (nor any chance to test) network addresses on MS-Windows.
Updated by gstrauss over 8 years ago
Windows provides inet_pton() in versions of Windows after Windows XP, so that patch needs to be adjusted for that. I don't think we should worry about supporting Windows XP or earlier.
Updated by ef over 8 years ago
gstrauss wrote:
so that patch needs to be adjusted for that.
By someone with access to an MS-Windows machine, probably.
Updated by gstrauss over 8 years ago
- Status changed from New to Patch Pending
- Target version changed from 1.4.x to 1.4.40
Submitted pull request https://github.com/lighttpd/lighttpd1.4/pull/52
Updated by gstrauss over 8 years ago
- Status changed from Patch Pending to Fixed
- % Done changed from 0 to 100
Applied in changeset bed63b79625cf98f41317b62519fa8abb7a82c1e.
Also available in: Atom