dont bundle IPv6-only RIs

This commit is contained in:
zzz
2014-09-02 14:09:41 +00:00
parent 1d2e01c8cd
commit c6b1f5053f

View File

@@ -787,16 +787,24 @@ class PersistentDataStore extends TransientDataStore {
continue;
}
boolean hasIntro = false;
boolean hasIPv4 = false;
for (RouterAddress addr : addrs) {
if ("SSU".equals(addr.getTransportStyle()) && addr.getOption("ihost0") != null) {
hasIntro = true;
break;
}
String host = addr.getHost();
if (host != null && host.contains("."))
hasIPv4 = true;
}
if (hasIntro) {
System.out.println("Skipping introduced " + key);
continue;
}
if (!hasIPv4) {
System.out.println("Skipping IPv6-only " + key);
continue;
}
File toFile = new File(toDir, file.getName());
// We could call ri.write() to avoid simultaneous change by the router
boolean ok = FileUtil.copy(file, toFile, true, true);