Add Me!Close Menu Navigation

PHP | Web Development | Object Oriented | MVC | MySQL | Apache

Add Me!Open Categories Menu

The great 127.255.255.255 IP enigma!

Hi all,

few may have noticed I’ve been rather quiet on my blog lately but I have the best excuse! I’ve been extremely busy working on an important project.

Topic of the day: the weird 127.255.255.255 IP I found in my system’s access log.

I have a MySQL table with a signed INT temporarily storing ip2long processed IPs of visitors. The ip2long function converts an IP into a number that can be stored and queried very simply using basic SQL.

The problem is, signed INT can only store numbers between 2147483647 and -2147483647. 2147483647 is trhe numerical representation of the IP 127.255.255.255. This doesn’t mean that someone from that IP connected to my site. It means that someone with an IP that translated to a higher number connected and I stored it in a too short field.

I altered my INT into a BIGINT and voila!

References:

http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html

http://fr2.php.net/ip2long

I hope this helps at least one confused fellow developer out there.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Posted By admin

2 Responses to “The great 127.255.255.255 IP enigma!”

  1. admin says:

    Yep, interesting too, especially considering it’s compatible with the inet_aton and inet_ntoa mysql functions. Good point.

Leave a Reply




Tag Cloud

Categories

Archive

Pages

Popular Posts