aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/CompilerCodegen.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2009-11-19 18:32:43 -0800
committerElliott Hughes <enh@google.com>2009-11-20 15:39:25 -0800
commit18090720f97d2fe718f11d0944b623676bf6b78b (patch)
tree0575b49f456c4f652552c109779a0edbd7cf594e /vm/compiler/codegen/CompilerCodegen.h
parent142ea85f73c1e76f5188986aaa76c11a293f57fd (diff)
Rewrite NetworkInterface's JNI for IPv6.
The old ioctl SIOCGIFCONF implementation of getNetworkInterfaces only returns IPv4 addresses. Now we've switched everything over to IPv6, that's not good enough. This change (a) implements glibc/BSD-like getifaddrs(3)/freeifaddrs(3) for Android, and (b) rewrites our getNetworkInterfaces to use that method. Of particular note is that we now do more of the work in Java. The JNI hands back a Java equivalent of getifaddrs(3)'s linked list of ifaddrs structs. The new package-private java.net.InterfaceAddress class serves as Java's "struct ifaddrs". The old implementation was also broken: SIOCGIFCONF doesn't actually return interface indexes from the kernel as the old code believed, so we were pulling the address family out of the IPv4 address it returned, leading us to assign the index 2 to all network interfaces. This caused all kinds of weird behavior later. I also had to fix GenericIPMreq so that its interface index field is actually set. The native code gets passed one of these objects when setNetworkInterface is called, so it's kind of important that the object identify which interface it's supposed to correspond to. I've also added missing copyright headers. This fixes all of the harmony tests on the simulator and on the device. It fixes several but not all of the jtreg MulticastSocket and IPv6 tests.
Diffstat (limited to 'vm/compiler/codegen/CompilerCodegen.h')
0 files changed, 0 insertions, 0 deletions