Moodle

Full IPv6 support

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 2.0
  • Component/s: Course, Libraries
  • Labels:
    None
  • Environment:
    Red Hat Enterprise 5.1, with a public IPv6 address from http://www.sixxs.net
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

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

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

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

Show
Eloy Lafuente (stronk7) added a comment - 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
Hide
Eloy Lafuente (stronk7) added a comment -

Linking with some more log-related problems...

Show
Eloy Lafuente (stronk7) added a comment - Linking with some more log-related problems...
Hide
Eloy Lafuente (stronk7) added a comment -

Also, note that the cleanremoteaddr() function seems to clean invalid (private) IPs and incorrect IPs (I guess IPv6 are handled as incorrect).

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Also, note that the cleanremoteaddr() function seems to clean invalid (private) IPs and incorrect IPs (I guess IPv6 are handled as incorrect). Ciao
Hide
Petr Škoda (skodak) added a comment -

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.

Show
Petr Škoda (skodak) added a comment - 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.
Hide
Petr Škoda (skodak) added a comment -

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....

Show
Petr Škoda (skodak) added a comment - 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....
Hide
Dave Habben added a comment -

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.

Show
Dave Habben added a comment - 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.
Hide
Petr Škoda (skodak) added a comment -

ah, right -will wait a bit and discuss it with more ppl, thanks

Show
Petr Škoda (skodak) added a comment - ah, right -will wait a bit and discuss it with more ppl, thanks
Hide
Tim Hunt added a comment -

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).

Show
Tim Hunt added a comment - 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).
Hide
Petr Škoda (skodak) added a comment -

working on subnets right now :-D

Show
Petr Škoda (skodak) added a comment - working on subnets right now :-D
Hide
Petr Škoda (skodak) added a comment -

ipv6 support should be implemented now, please reopen in case I overlooked something or it does not work as expected

thanks everybody!

Show
Petr Škoda (skodak) added a comment - ipv6 support should be implemented now, please reopen in case I overlooked something or it does not work as expected thanks everybody!

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: