ipv6

Christian Harms's picture

IPv6 request crashed my google app engine application

My IP geo location script cache requests coming from the same ip range (subnet mask 255.255.255.0) named as class-c ip address (last number cutted). This value is the reference for look up in memcache. But yesterday I got an exception while calculating the ip from the request object.

  1. def get(self):
  2.     ipStr = self.request.remote_addr
  3.     classC = reduce(lambda a, b: int(a)*256+int(b), ipStr.split(".")[:3])
  4.     logging.info("request from classC ip address:: %d" % classC)
  5.     ...

This request crashed (TypeError: int argument required) by using an IPv6 address (found in the google app engine logs):Read more

Syndicate content