Package: libtorrent
Severity: important
Version: 0.13.8-2
Tags: patch
User:hahwang
Usertags: hurd


I decide to fix a broken package found at the recommended page https://people.debian.org/~sthibault/out_of_date2.txt named `libtorrent`.

      After I download the package source and try to build without any modifications under the debian hurd running in qemu (debian-hurd-20210219.img),  I got the following error.

      ```
   socket_fd.cc: In member function 'bool torrent::SocketFd::set_priority(torrent::SocketFd::priority_type)':    socket_fd.cc:78:43: error: 'IPV6_TCLASS' was not declared in this scope; did you mean 'IPOPT_CLASS'?
    ```

   and it matches with what that page said.

To fix this bug, thanks to the help of people at debian-hurd & bug-hurd mailing list,  I decide to block the usage of the `IPV6_TCLASS` when it is not defined.

Hope for reviews! The patch is attached at the end of this mail.

Thank you!

---
hahawang

--- a/src/net/socket_fd.cc
+++ b/src/net/socket_fd.cc
@@ -71,7 +71,11 @@
   int opt = p;

   if (m_ipv6_socket)
+#ifdef IPV6_TCLASS
     return setsockopt(m_fd, IPPROTO_IPV6, IPV6_TCLASS, &opt, sizeof(opt)) == 0;
+#else
+    return false;
+#endif
   else
     return setsockopt(m_fd, IPPROTO_IP, IP_TOS, &opt, sizeof(opt)) == 0;
 }

Reply via email to