Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 disabled #7

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 14 comments
Open

IPv6 disabled #7

GoogleCodeExporter opened this issue Mar 14, 2015 · 14 comments

Comments

@GoogleCodeExporter
Copy link
Contributor

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
Copy link
Contributor Author

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Contributor Author

[deleted comment]

@GoogleCodeExporter
Copy link
Contributor Author

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

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

@GoogleCodeExporter
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

Forget me last comment, got it working now.

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

@GoogleCodeExporter
Copy link
Contributor Author

How is it working?

I have the same issue.

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

@GoogleCodeExporter
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

ok thx for the info for the instructions

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

@devpack
Copy link

devpack commented Jun 17, 2016

What if in pyconfig.h you change #undef ENABLE_IPV6 to #define ENABLE_IPV6 1 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants