Skip to content

Commit 940aa12

Browse files
committed
Skip IPv6 UDP tracker addresses when IPv6 disabled
1 parent d4c0fa7 commit 940aa12

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

core/src/com/biglybt/core/tracker/client/impl/bt/TRTrackerBTAnnouncerImpl.java

+16
Original file line numberDiff line numberDiff line change
@@ -2088,8 +2088,19 @@ protected TRTrackerAnnouncerResponseImpl updateSupport() {
20882088

20892089
Throwable last_error = null;
20902090

2091+
boolean all_skipped = true;
2092+
2093+
boolean ipv6_enabled = NetworkAdmin.getSingleton().isIPV6Enabled();
2094+
20912095
for ( InetSocketAddress destination: url_addresses ){
20922096

2097+
if ( destination.getAddress() instanceof Inet6Address && !ipv6_enabled ){
2098+
2099+
continue;
2100+
}
2101+
2102+
all_skipped = false;
2103+
20932104
try{
20942105
PRUDPPacketHandler handler = PRUDPPacketHandlerFactory.getHandler( handler_port );
20952106

@@ -2344,6 +2355,11 @@ protected TRTrackerAnnouncerResponseImpl updateSupport() {
23442355
}
23452356
}
23462357

2358+
if ( all_skipped ){
2359+
2360+
throw( new Exception( "IPv6 disabled" ));
2361+
}
2362+
23472363
if ( last_error != null ){
23482364

23492365
throw( last_error );

0 commit comments

Comments
 (0)