Patch to handle IPv4-mapped addresses
authorIOhannes m zmölnig <zmoelnig@umlautS.umlaeute.mur.at>
Mon, 2 Sep 2019 09:27:46 +0000 (11:27 +0200)
committerIOhannes m zmölnig <zmoelnig@umlautS.umlaeute.mur.at>
Mon, 2 Sep 2019 09:27:46 +0000 (11:27 +0200)
Thanks: Aaron Wyatt <dev@psi-borg.org>
Closes: #939126
debian/patches/convert_IPv4.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/convert_IPv4.patch b/debian/patches/convert_IPv4.patch
new file mode 100644 (file)
index 0000000..8e034d9
--- /dev/null
@@ -0,0 +1,31 @@
+Description: convert IPv4-mapped addresses to IPv4 addresses
+ Other clients hang at "Waiting for Peer..." when attempting to connect to
+ jacktrip running as a server. This is because of a change to the way that
+ QHostAddress works in Qt5, resulting in the return of an IPv4-mapped address
+ instead of an IPv4 address. The attached a patch fixes this (restoring the
+ behaviour shown by Qt4).
+Author: Aaron Wyatt <dev@psi-borg.org>
+Forwarded: no
+Last-Update: 2019-09-02
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- jacktrip.orig/src/JackTrip.cpp
++++ jacktrip/src/JackTrip.cpp
+@@ -450,7 +450,16 @@
+   UdpSockTemp.readDatagram(buf, 1, &peerHostAddress, &peer_port);
+   UdpSockTemp.close(); // close the socket
+-  mPeerAddress = peerHostAddress.toString();
++  // Convert any IPv4-mapped address to an actual IPv4 address
++  // (Due to a change in the way that QHostAddress works in Qt5)
++  bool couldConvert;
++  QHostAddress ipv4Address(peerHostAddress.toIPv4Address(&couldConvert));
++  if (couldConvert) {
++    mPeerAddress = ipv4Address.toString();
++  } else {
++    mPeerAddress = peerHostAddress.toString();
++  }
++
+   cout << "Client Connection Received from IP : " 
+        << qPrintable(mPeerAddress) << endl;
+   cout << gPrintSeparator << endl;
index d06d6f2cbb4747e90e11634c1de60dc8c392548f..cd2f3e80d4d1d23d73b55877b2fe6fa50ee264c6 100644 (file)
@@ -1,3 +1,4 @@
+convert_IPv4.patch
 system-rtaudio.patch
 rtaudio411.patch
 remove_sflogo.patch