Export to GitHub

python-for-android - issue #7

IPv6 disabled


Posted on Mar 20, 2011 by Massive Ox

What device(s) are you experiencing the problem on? HTC Desire HD

What firmware version are you running on the device? Android 2.2

What steps will reproduce the problem? 1. Create the following Python script: import socket print socket.has_ipv6 s = socket.socket(socket.AF_INET6, socket. SOCK_DGRAM) s.bind(("::1", 9000)) s.recv(1024)

What is the expected output? True [Wait for incoming connection]

What do you see instead? False Exception: socket.error: getsockaddrarg: bad family

What version of the product are you using? On what operating system? SL4A r3 + Python 2.6.2

Please provide any additional information below. Python seems to be compiled without --enable-ipv6. Please enable it in the build.

Thanks

Comment #1

Posted on Mar 21, 2011 by Swift Horse

I've had a serious look at this, but it looks like the Android NDK doesn't provide ipv6 support. Or at any rate, not in a form Python can cope with.

When I enable ipv6, I get the following error:

/home/robbie/python-for-android/python-build/python/jni/../../python-src/Modules/getaddrinfo.c:433: error: 'struct in6_addr' has no member named 's6_addr8'

I'm open to suggestions, though.

Comment #2

Posted on Jun 27, 2012 by Happy Monkey

Comment deleted

Comment #3

Posted on Aug 2, 2012 by Happy Panda

See upstream cpython issue http://bugs.python.org/issue15538

Comment #4

Posted on Aug 11, 2012 by Helpful Kangaroo

The Patch [PATCH] python: enabled IPv6 socket support from http://permalink.gmane.org/gmane.comp.lib.uclibc.buildroot/40455 will solve the premature exit of the 'configure.sh' script when cross-compiling for android. The 'configure.sh' script echo before exit the message: """ 'Fatal: You must get working getaddrinfo() function.' 'or you can specify "--disable-ipv6"'. """

After compilation the above step that will reproduce the problem return 'true'

Comment #5

Posted on Aug 11, 2012 by Happy Bear

Does "s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)" succeed ?

Comment #6

Posted on Aug 11, 2012 by Happy Bear

Forget me last comment, got it working now.

Comment #7

Posted on Jun 10, 2013 by Happy Monkey

How is it working?

I have the same issue.

Comment #8

Posted on Jun 10, 2013 by Happy Bear

You need to rebuild Python with ipv6 enabled, see patch for Python 2.7: http://code.google.com/p/android-python27/source/browse/python-build/patch/Python-2.7.2-enable_ipv6.patch

Comment #9

Posted on Jun 10, 2013 by Happy Monkey

Ok thanks. Is there no APK Package yet? If you have python could you provide it somewhere?

Comment #10

Posted on Jun 10, 2013 by Happy Bear

You can build your own APK following instructions there: http://code.google.com/p/android-python27/ (Python 2.7 with ipv6 would be embeded)

Comment #11

Posted on Jun 10, 2013 by Happy Monkey

Ah ok these are ust zip packages. Is it statically linked? So you could just provide the binary.

Comment #12

Posted on Jun 10, 2013 by Happy Monkey

Ooops, i edited that last comment. I asked whether there is no python with ipv6 readily availabe?

Comment #13

Posted on Jun 10, 2013 by Happy Monkey

ok thx for the info for the instructions

Status: Accepted

Labels:
Type-Defect Priority-Medium