diff --git a/deskutils/kdeconnect-kde/Makefile b/deskutils/kdeconnect-kde/Makefile index d3083ca92e82..748e8a9e4720 100644 --- a/deskutils/kdeconnect-kde/Makefile +++ b/deskutils/kdeconnect-kde/Makefile @@ -1,38 +1,39 @@ PORTNAME= kdeconnect-kde DISTVERSION= ${KDE_APPLICATIONS_VERSION} +PORTREVISION= 1 CATEGORIES= deskutils kde kde-applications MAINTAINER= kde@FreeBSD.org COMMENT= Support for KDE to interface between your phone and your computer WWW= https://community.kde.org/KDEConnect LICENSE= GPLv2 LIB_DEPENDS= libdbus-1.so:devel/dbus \ libfakekey.so:x11/libfakekey \ libwayland-client.so:graphics/wayland \ libxkbcommon.so:x11/libxkbcommon \ libKF6PulseAudioQt.so:audio/pulseaudio-qt BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto \ wayland-protocols>=0:graphics/wayland-protocols RUN_DEPENDS= sshpass:security/sshpass \ sshfs:filesystems/sshfs USES= cmake compiler:c++17-lang desktop-file-utils gettext-tools \ gl kde:6 localbase:ldflags pkgconfig qt:6 ssl tar:xz xorg USE_GL= gl opengl # GLX USE_KDE= bookmarks colorscheme completion config configwidgets \ coreaddons crash dbusaddons doctools guiaddons i18n iconthemes \ itemmodels itemviews jobwidgets kcmutils kio kirigami-addons \ kirigami2 notifications package people qqc2-desktop-style \ service solid statusnotifieritem widgetsaddons windowsystem \ ecm:build USE_QT= base connectivity declarative multimedia wayland USE_XORG= ice sm x11 xext xtst USE_LDCONFIG= ${QT_QMLDIR}/org/kde/kdeconnect OPTIONS_DEFINE= DOCS KDE_APPLICATIONS_SHLIB_VER=${KDE_APPLICATIONS_VERSION} .include diff --git a/deskutils/kdeconnect-kde/files/patch-core_backends_lan_lanlinkprovider.cpp b/deskutils/kdeconnect-kde/files/patch-core_backends_lan_lanlinkprovider.cpp index 47e10fb8326f..9fb5f425bff6 100644 --- a/deskutils/kdeconnect-kde/files/patch-core_backends_lan_lanlinkprovider.cpp +++ b/deskutils/kdeconnect-kde/files/patch-core_backends_lan_lanlinkprovider.cpp @@ -1,19 +1,32 @@ ---- core/backends/lan/lanlinkprovider.cpp.orig 2023-12-18 22:14:59 UTC +--- core/backends/lan/lanlinkprovider.cpp.orig 2025-11-01 18:19:03 UTC +++ core/backends/lan/lanlinkprovider.cpp -@@ -291,6 +291,16 @@ void LanLinkProvider::udpBroadcastReceived() - m_lastConnectionTime[deviceId] = now; +@@ -427,6 +427,7 @@ void LanLinkProvider::encrypted() - int tcpPort = receivedPacket->get(QStringLiteral("tcpPort")); -+ // convert IPv6 addresses of type "v4-mapped" to IPv4 -+ QHostAddress addr = sender; -+ if (addr.protocol() == QAbstractSocket::IPv6Protocol) { -+ bool success; -+ QHostAddress convertedAddr = QHostAddress(addr.toIPv4Address(&success)); -+ if (success) { -+ // qCDebug(KDECONNECT_CORE) << "Converting IPv6" << addr << "to IPv4" << convertedAddr; -+ sender = convertedAddr; + NetworkPacket *identityPacket = m_receivedIdentityPackets[socket].np; + ++ QString deviceId = identityPacket->get(QStringLiteral("deviceId")); + int protocolVersion = identityPacket->get(QStringLiteral("protocolVersion"), -1); + if (protocolVersion >= 8) { + disconnect(socket, &QObject::destroyed, nullptr, nullptr); +@@ -435,7 +436,7 @@ void LanLinkProvider::encrypted() + NetworkPacket myIdentity = KdeConnectConfig::instance().deviceInfo().toIdentityPacket(); + socket->write(myIdentity.serialize()); + socket->flush(); +- connect(socket, &QIODevice::readyRead, this, [this, socket, protocolVersion]() { ++ connect(socket, &QIODevice::readyRead, this, [this, socket, protocolVersion, deviceId]() { + if (!socket->canReadLine()) { + // This can happen if the packet is large enough to be split in two chunks + return; +@@ -452,6 +453,12 @@ void LanLinkProvider::encrypted() + int newProtocolVersion = secureIdentityPacket->get(QStringLiteral("protocolVersion"), 0); + if (newProtocolVersion != protocolVersion) { + qCWarning(KDECONNECT_CORE) << "Protocol version changed half-way through the handshake:" << protocolVersion << "->" << newProtocolVersion; ++ return; + } -+ } - if (tcpPort < MIN_TCP_PORT || tcpPort > MAX_TCP_PORT) { - qCDebug(KDECONNECT_CORE) << "TCP port outside of kdeconnect's range"; - delete receivedPacket; ++ QString newDeviceId = secureIdentityPacket->get(QStringLiteral("deviceId")); ++ if (newDeviceId != deviceId) { ++ qCWarning(KDECONNECT_CORE) << "Device ID changed half-way through the handshake:" << deviceId << "->" << newDeviceId; ++ return; + } + DeviceInfo deviceInfo = DeviceInfo::FromIdentityPacketAndCert(*secureIdentityPacket, socket->peerCertificate()); +