more IPv6 fixes

pull/1/head
orbiter 10 years ago
parent d65e3f2b53
commit ca9cd7b58a

@ -136,7 +136,7 @@ Please clone our code and help with development!
The code is licensed under the GPL v2.
Compiling YaCy:
- you need java 1.6 and ant
- you need java 1.7 and ant
- just compile: "ant clean all" - then you can "./startYACY.sh"
- create a release tarball: "ant dist"
- create a Mac OS release: "ant distMacApp" (works only on a Mac)

@ -1043,7 +1043,8 @@ public class Domains {
}
public static Set<String> myPublicIPs() {
Set<String> h = new HashSet<>(publicIPv4HostAddresses.size() + publicIPv6HostAddresses.size());
// use a LinkedHashSet to get an order of IPs where the IPv4 are preferred to get a better compatibility with older implementations
Set<String> h = new LinkedHashSet<>(publicIPv4HostAddresses.size() + publicIPv6HostAddresses.size());
for (InetAddress i: publicIPv4HostAddresses) h.add(i.getHostAddress());
for (InetAddress i: publicIPv6HostAddresses) h.add(i.getHostAddress());
return h;

@ -2082,7 +2082,7 @@ public class FTPClient {
// save ip address in high byte order
// byte[] Bytes = LocalIp.getAddress();
final byte[] b = Domains.myPublicLocalIP().getAddress();
final byte[] b = Domains.myPublicIPv4().iterator().next().getAddress();
// bytes greater than 127 should not be printed as negative
final short[] s = new short[4];

Loading…
Cancel
Save