•  
      request #8189 session.ip_addr too short for IPv6 addresses
    Infos
    #8189
    Marijn van Zon (sunmar)
    2015-07-17 14:29
    2015-07-01 23:47
    8214
    Details
    session.ip_addr too short for IPv6 addresses
    After installing Tuleap using the Full Installation I was unable to login. I did some debugging and it turned out to be because I was connecting to the site via IPv6. The address got truncated upon insertion into the database because the column tuleap.session.ip_addr is a CHAR(15) while an IPv6 address is much larger than that. It can be up to 45 characters long if you include possible tunneling.

    The issue is fixed by changing the ip_addr column from a CHAR(15) to a CHAR(45) or VARCHAR(45).

    The issue does not only affect new installations but probably affects existing installations as well on servers that support IPv6. Any other places that store ip addresses might need to be checked as well.
    Authentication & LDAP
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2015-07-17
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Patch integrated into Tuleap 8.4.99.1.

    Thanks for your input!

    • Status changed from Under review to Closed
    • Close date set to 2015-07-17
    User avatar
    Thomas Gerbet (tgerbet)2015-07-15 22:32
    I have fixed the issue and do some quick tests, I have not encounter other problems. However, if you do, please do not hesitate to open an new request.

    A patch is under review: gerrit #4219.

    • Status changed from New to Under review
    • Reported in version changed from 8.3 to All
    • Platform cleared values: CentOS 6
    User avatar
    Thomas Gerbet (tgerbet)2015-07-13 09:49
    I think I can answer the question: an IPv6 is represented with 8 groups of 4 digits with a separator between each group (8*4+7) which means 39 characters seem enough to store an IPv6. However, to facilitate the transition to IPv6, an IPv6 could be mapped to an IPv4 (RFC 4291 Section 2.5.5.1 and 2.5.5.2). In that case, the last 32 bits of the address are displayed with the IPv4 style format. In that case we need at least 45 characters (6*4+6+4*3+3).
    The value of INET6_ADDRSTRLEN is defined to 46 chars because it counts 45 chars for the address and the \0 at the end of the string.