summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorAdam Vartanian <flooey@google.com>2019-03-14 12:48:04 +0000
committerAdam Vartanian <flooey@google.com>2019-03-14 13:25:21 +0000
commit1e9ca3280c13c7cbaffdfc1043ed1207fca01d56 (patch)
tree863f59a16f593e51ba14ec3fde4dfaf0c4b530cf /annotations/generate_annotated_java_files.py
parent20ac931d0f1926eed5b331be203388a161b4c2fa (diff)
Fix bug with bind()/connect() and IPv4 addresses
Our standard utilities for converting InetAddress to sockaddr convert IPv4 addresses to IPv4-mapped sockaddr_in6 instances. This works fine for most use cases, but when calling functions with AF_INET (aka IPv4) sockets returned from Libcore.os.socket(), they need to be given a sockaddr_in or they fail with EAFNOSUPPORT. We have a utility to deal with this (NET_IPV4_FALLBACK), but the versions of bind() and connect() that took SocketAddress instances instead of InetAddress instances didn't use it. Follow the lead of sendTo() and convert InetSocketAddress instances to InetAddress/port pairs and call the InetAddress version of the call so we get the benefit of NET_IPV4_FALLBACK. Bug: 123562238 Test: cts -m CtsLibcoreTestCases Change-Id: Ib8c1fda7be3dda8e6eee31fd15f2d0c4567a5712
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions