Issue Details (XML | Word | Printable)

Key: MDL-14123
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Dave Habben
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Full IPv6 support

Created: 01/Apr/08 04:22 AM   Updated: 10/Jan/09 06:44 AM
Return to search
Component/s: Course, Lib
Affects Version/s: 1.9
Fix Version/s: 2.0

Environment: Red Hat Enterprise 5.1, with a public IPv6 address from http://www.sixxs.net
Issue Links:
Relates

Database: MySQL
Participants: Dave Habben, Eloy Lafuente (stronk7), Petr Skoda and Tim Hunt
Security Level: None
Resolved date: 10/Jan/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
When accessing the web server using an IPv6 address, the "Live Logs" feature no longer displays a correct address. Instead it displays the text "Click here ...".

With IPv4 the live logs display:
Time IP Address Full name Action Information
Mon March 31 2008, 01:09 PM 192.168.1.1 John Doe course view CIS252: Advanced Routing
 the IP Address link also includes a link to:
http://moodle.svcc.edu/iplookup/index.php?ip=192.168.1.1&user=2

With IPv6 the live logs display:
Time IP Address Full name Action Information
Mon March 31 2008, 02:12 PM Click here ... John Doe course view CIS252: Advanced Routing
 the IP Address link does not contain the IPv6 address and only includes:
http://moodle.svcc.edu/iplookup/index.php?ip=&user=2

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) added a comment - 01/Apr/08 09:23 AM
Hi Dave, thanks for your report.

I guess this is caused by the log->ip column in DB accepting only 15cc (IPv4). Can you try manually increasing the column size in your server? What would be a correct length?

I would propose to:

  • Under Moodle 1.9, check for length before inserting, because can be breaking other DBs no so "relaxed" as MySQL. If length excess, change it to something identifiable and prevent iplookup link completely for those records.
  • Under Moodle 2.0, change column specs to something able to store IPv6 addresses and check if iplookup works with IPv6. Depending on that, enable the link or no.

This should be fixed consistently in all reports showing IPs, not only live logs.

Assigning to Mathieu...TIA!

Ciao


Eloy Lafuente (stronk7) added a comment - 01/Apr/08 09:28 AM
Linking with some more log-related problems...

Eloy Lafuente (stronk7) added a comment - 01/Apr/08 09:34 AM
Also, note that the cleanremoteaddr() function seems to clean invalid (private) IPs and incorrect IPs (I guess IPv6 are handled as incorrect).

Ciao


Petr Skoda added a comment - 06/Jan/09 10:19 PM
changing name of bug to Full IPv6 support - this will require database changes, I am afraid it is not possible to fully fix in 1.9.x - sorry.

Petr Skoda added a comment - 06/Jan/09 10:36 PM
hmm, there are several ways how to write ipv6:
ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 - 39chars
FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:129.144.152.138 - 45chars
and compressed forms

I think it should be better to use 45 chars. going to change all install.xml's now....


Dave Habben added a comment - 06/Jan/09 11:47 PM
With the 45 char comment, I think you may be referring to http://www.ietf.org/rfc/rfc3513.txt section 2.2.3
There are not as many fields with the bits all set to one as you have listed above.

Uncompressed this is what it would look like:
0000:0000:0000:0000:0000:FFFF:129.144.152.138
once leading zeros are compressed this could be smaller for storage in the database:
::FFFF:129.144.152.138
or
0:0:0:0:0:FFFF:129.144.152.138
if you'd prefer.


Petr Skoda added a comment - 07/Jan/09 12:50 AM
ah, right -will wait a bit and discuss it with more ppl, thanks

Tim Hunt added a comment - 07/Jan/09 11:19 AM
Petr, I know you have not finished, so you may know this already, but there is the quiz.subnet field, which takes a list of IP addresses, or address ranges, and the address_in_subnet method in moodlelib.php (which has extensive unit tests).

Petr Skoda added a comment - 07/Jan/09 05:20 PM
working on subnets right now :-D

Petr Skoda added a comment - 10/Jan/09 06:44 AM
ipv6 support should be implemented now, please reopen in case I overlooked something or it does not work as expected

thanks everybody!