2004-10-01 jrandom

* Explicitly refuse IPv6 addresses, since only some peers support
      them and we want fully reachable peers.
This commit is contained in:
jrandom
2004-10-01 11:49:02 +00:00
committed by zzz
parent c0b8e62135
commit 34f74cd6ef
3 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,8 @@
$Id: history.txt,v 1.24 2004/09/30 10:58:55 jrandom Exp $
$Id: history.txt,v 1.25 2004/10/01 04:39:14 jrandom Exp $
2004-10-01 jrandom
* Explicitly refuse IPv6 addresses, since only some peers support
them and we want fully reachable peers.
2004-10-01 jrandom
* Additional error handling for a variety of transport layer errors.

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.34 $ $Date: 2004/09/30 10:58:55 $";
public final static String ID = "$Revision: 1.35 $ $Date: 2004/10/01 04:39:14 $";
public final static String VERSION = "0.4.1";
public final static long BUILD = 1;
public final static long BUILD = 2;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -116,6 +116,12 @@ public class TCPAddress {
try {
InetAddress addr = InetAddress.getByName(_host);
byte quad[] = addr.getAddress();
if (quad.length != 4) {
if (_log.shouldLog(Log.ERROR))
_log.error("Refusing IPv6 address (" + _host + " / " + addr.getHostAddress() + ") "
+ " since not all peers support it, and we don't support restricted routes");
return false;
}
if (quad[0] == (int)127) return false;
if (quad[0] == (int)10) return false;
if ( (quad[0] == (int)172) && (quad[1] >= (int)16) && (quad[1] <= (int)31) ) return false;