[PHP] Being ready
Shadow Hawkins on Wednesday, 10 September 2008 16:27:44
Let's first give a small introduction. I am a freelance php/web programmer and mostly deliver a custom made CMS for every website. The core of this CMS is about the same for every website and require functionality is added to modules. The core contains (at least) the database, logging and authentication layers.
Now the last 2 parts concern me a bit. While using debug logging (yes, I could let apache do it but it's better to make statistics when doing it myself) IP addresses are saved in the database. Depending on my core version (I used to just save it in a varchar but recently got to know ip2long) ip's are saved in a specified way, but these functions can't handle IPv6 (yet?). Also for authentication the IP address is saved in the database but an invalid IP would make a session completely useless.
What are your point of views on this and how would I counter this. I'm busy making my webservers available over IPv6, and although IPv6 isn't used that much yet, I would like to be able to give the same stability and security over v6 as I can do over v6. Just start saving IPv6 addresses and append ffff:: in front of the v4 addresses? Or is it complete useless to be thinking about this yet. Awaiting your thoughts :)
[PHP] Being ready
Jeroen Massar on Wednesday, 10 September 2008 16:38:35
The assumption that an IP address is only 32bits has been wrong for the last 10 years. For most SQL-alike databases, storing them as a varchar is a good way to solve it. If your database supports the IPv4 and/or IPv6 types is better of course.
If you want to use a datatype that stores both IPv6 and IPv4 in one record, then you can of course either choose ::a.b.c.d or even (my choice) ::a.b.c.d, which is also valid. Neither of the two should ever be seen on-wire though.
For C code and related please see Eva's excellent document at:
http://gsyc.escet.urjc.es/~eva/IPv6-web/ipv6.html
[PHP] Being ready
Shadow Hawkins on Monday, 17 November 2008 13:24:44 If you want to use a datatype that stores both IPv6 and IPv4 in one record, then you can of course either choose ::a.b.c.d or even (my choice) ::a.b.c.d, which is also valid. Neither of the two should ever be seen on-wire though.
You wrote "::a.b.c.d or even (my choice) ::a.b.c.d" -- didn't you just write the same thing (::a.b.c.d ) twice?
[PHP] Being ready
Shadow Hawkins on Saturday, 29 November 2008 14:21:48
I think the definitive work on IPv6 addresses and IPv4 addresses in programming languages can be fond in RFC 3542.
Posting is only allowed when you are logged in. |