mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 14:15:14 +00:00
Ignore udp packets on the old port for devices that know about the new port
This commit is contained in:
@@ -76,6 +76,7 @@ import io.netty.util.concurrent.GenericFutureListener;
|
||||
public class LanLinkProvider extends BaseLinkProvider {
|
||||
|
||||
public static final int MIN_VERSION_WITH_SSL_SUPPORT = 6;
|
||||
public static final int MIN_VERSION_WITH_NEW_PORT_SUPPORT = 7;
|
||||
|
||||
public static final String KEY_CUSTOM_DEVLIST_PREFERENCE = "device_list_preference";
|
||||
|
||||
@@ -275,6 +276,10 @@ public class LanLinkProvider extends BaseLinkProvider {
|
||||
}
|
||||
|
||||
//Log.i("KDE/LanLinkProvider", "Identity package received, creating link");
|
||||
if (identityPackage.getInt("protocolVersion") >= MIN_VERSION_WITH_NEW_PORT_SUPPORT && identityPackage.getInt("tcpPort") < port) {
|
||||
Log.w("KDE/LanLinkProvider", "Ignoring a udp broadcast from an old port because it comes from a device which knows about the new port.");
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
Bootstrap bootstrap = new Bootstrap();
|
||||
|
@@ -36,7 +36,7 @@ import java.util.Set;
|
||||
|
||||
public class NetworkPackage {
|
||||
|
||||
public final static int ProtocolVersion = 6;
|
||||
public final static int ProtocolVersion = 7;
|
||||
|
||||
public final static String PACKAGE_TYPE_IDENTITY = "kdeconnect.identity";
|
||||
public final static String PACKAGE_TYPE_PAIR = "kdeconnect.pair";
|
||||
|
Reference in New Issue
Block a user