myGod0rz / python-for-android

Automatically exported from code.google.com/p/python-for-android
Apache License 2.0
0 stars 0 forks source link

IPv6 disabled #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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

Original issue reported on code.google.com by marku...@gmail.com on 20 Mar 2011 at 4:09

GoogleCodeExporter commented 8 years ago
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.

Original comment by rjmatthews62 on 21 Mar 2011 at 3:00

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
See upstream cpython issue http://bugs.python.org/issue15538

Original comment by phihag.de@gmail.com on 2 Aug 2012 at 3:28

GoogleCodeExporter commented 8 years ago
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'

Original comment by valerij....@gmail.com on 11 Aug 2012 at 1:44

GoogleCodeExporter commented 8 years ago
Does "s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)" succeed ?

Original comment by anthony....@gmail.com on 11 Aug 2012 at 8:17

GoogleCodeExporter commented 8 years ago
Forget me last comment, got it working now.

Original comment by anthony....@gmail.com on 11 Aug 2012 at 8:26

GoogleCodeExporter commented 8 years ago
How is it working?

I have the same issue.

Original comment by sebastia...@gmail.com on 10 Jun 2013 at 12:45

GoogleCodeExporter commented 8 years ago
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/Pytho
n-2.7.2-enable_ipv6.patch

Original comment by anthony....@gmail.com on 10 Jun 2013 at 12:49

GoogleCodeExporter commented 8 years ago
Ok thanks. Is there no APK Package yet?
If you have python could you provide it somewhere?

Original comment by sebastia...@gmail.com on 10 Jun 2013 at 12:52

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

Original comment by anthony....@gmail.com on 10 Jun 2013 at 12:55

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

Original comment by sebastia...@gmail.com on 10 Jun 2013 at 12:55

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

Original comment by sebastia...@gmail.com on 10 Jun 2013 at 12:56

GoogleCodeExporter commented 8 years ago
ok thx for the info for the instructions

Original comment by sebastia...@gmail.com on 10 Jun 2013 at 12:56