From 0fabbd81b312e6f6c9fd2ee40aa7bd05f6d7a5b8 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Wed, 6 Oct 2021 19:12:52 -0300 Subject: [PATCH] catch ipv6 ioctl throwing when someone runs lokinet with no ipv6 --- ...-throwing-when-someone-runs-lokinet-.patch | 32 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 33 insertions(+) create mode 100644 debian/patches/0003-catch-ipv6-ioctl-throwing-when-someone-runs-lokinet-.patch diff --git a/debian/patches/0003-catch-ipv6-ioctl-throwing-when-someone-runs-lokinet-.patch b/debian/patches/0003-catch-ipv6-ioctl-throwing-when-someone-runs-lokinet-.patch new file mode 100644 index 000000000..7dee3b4cb --- /dev/null +++ b/debian/patches/0003-catch-ipv6-ioctl-throwing-when-someone-runs-lokinet-.patch @@ -0,0 +1,32 @@ +From: Jeff Becker +Date: Wed, 6 Oct 2021 17:48:18 -0400 +Subject: catch ipv6 ioctl throwing when someone runs lokinet with no ipv6 + +--- + llarp/vpn/linux.hpp | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/llarp/vpn/linux.hpp b/llarp/vpn/linux.hpp +index 5401ef1..0f47636 100644 +--- a/llarp/vpn/linux.hpp ++++ b/llarp/vpn/linux.hpp +@@ -57,7 +57,6 @@ namespace llarp::vpn + control.ioctl(SIOCGIFINDEX, &ifr); + const int ifindex = ifr.ifr_ifindex; + +- IOCTL control6{AF_INET6}; + for (const auto& ifaddr : m_Info.addrs) + { + if (ifaddr.fam == AF_INET) +@@ -78,9 +77,9 @@ namespace llarp::vpn + ifr6.ifindex = ifindex; + try + { +- control6.ioctl(SIOCSIFADDR, &ifr6); ++ IOCTL{AF_INET6}.ioctl(SIOCSIFADDR, &ifr6); + } +- catch (permission_error& ex) ++ catch (std::exception& ex) + { + LogError("we are not allowed to use IPv6 on this system: ", ex.what()); + } diff --git a/debian/patches/series b/debian/patches/series index 24dd9f766..abe4db08c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 0007-Pass-debian-version-as-GIT_VERSION.patch 0002-set-base-v6-address-to-nullopt-when-explicit-empty-s.patch +0003-catch-ipv6-ioctl-throwing-when-someone-runs-lokinet-.patch