diff --git a/contrib/format.sh b/contrib/format.sh index 6f4e8af36..a51fbaa9a 100755 --- a/contrib/format.sh +++ b/contrib/format.sh @@ -21,23 +21,23 @@ fi cd "$(dirname $0)/../" if [ "$1" = "verify" ] ; then - if [ $($binary --output-replacements-xml $(find jni daemon llarp include pybind | grep -E '\.([hc](pp)?|m(m)?)$' | grep -v '\#') | grep '' | wc -l) -ne 0 ] ; then + if [ $($binary --output-replacements-xml $(find jni daemon llarp include pybind | grep -E '\.([hc](pp)?|m(m)?)$' | grep -v '#') | grep '' | wc -l) -ne 0 ] ; then exit 2 fi else - $binary -i $(find jni daemon llarp include pybind | grep -E '\.([hc](pp)?|m(m)?)$' | grep -v '\#') &> /dev/null + $binary -i $(find jni daemon llarp include pybind | grep -E '\.([hc](pp)?|m(m)?)$' | grep -v '#') &> /dev/null fi swift_format=$(command -v swiftformat 2>/dev/null) if [ $? -eq 0 ]; then if [ "$1" = "verify" ] ; then - for f in $(find daemon | grep -E '\.swift$' | grep -v '\#') ; do + for f in $(find daemon | grep -E '\.swift$' | grep -v '#') ; do if [ $($swift_format --quiet --dryrun < "$f" | diff "$f" - | wc -l) -ne 0 ] ; then exit 3 fi done else - $swift_format --quiet $(find daemon | grep -E '\.swift$' | grep -v '\#') + $swift_format --quiet $(find daemon | grep -E '\.swift$' | grep -v '#') fi fi diff --git a/llarp/apple/route_manager.cpp b/llarp/apple/route_manager.cpp index 5265faf58..021095eaf 100644 --- a/llarp/apple/route_manager.cpp +++ b/llarp/apple/route_manager.cpp @@ -38,14 +38,16 @@ namespace llarp::apple trampoline_active = enable; } - void RouteManager::AddDefaultRouteViaInterface(vpn::NetworkInterface&) + void + RouteManager::AddDefaultRouteViaInterface(vpn::NetworkInterface&) { check_trampoline(true); if (callback_context and route_callbacks.add_default_route) route_callbacks.add_default_route(callback_context); } - void RouteManager::DelDefaultRouteViaInterface(vpn::NetworkInterface&) + void + RouteManager::DelDefaultRouteViaInterface(vpn::NetworkInterface&) { check_trampoline(false); if (callback_context and route_callbacks.del_default_route) diff --git a/llarp/apple/route_manager.hpp b/llarp/apple/route_manager.hpp index 69403c04d..b69904276 100644 --- a/llarp/apple/route_manager.hpp +++ b/llarp/apple/route_manager.hpp @@ -15,12 +15,10 @@ namespace llarp::apple /// These are called for poking route holes, but we don't have to do that at all on macos /// because the appex isn't subject to its own rules. - void - AddRoute(net::ipaddr_t /*ip*/, net::ipaddr_t /*gateway*/) override + void AddRoute(net::ipaddr_t /*ip*/, net::ipaddr_t /*gateway*/) override {} - void - DelRoute(net::ipaddr_t /*ip*/, net::ipaddr_t /*gateway*/) override + void DelRoute(net::ipaddr_t /*ip*/, net::ipaddr_t /*gateway*/) override {} void diff --git a/llarp/dns/server.cpp b/llarp/dns/server.cpp index b102c0219..4c1344d70 100644 --- a/llarp/dns/server.cpp +++ b/llarp/dns/server.cpp @@ -213,9 +213,9 @@ namespace llarp::dns { if (dns.hostString() == "127.0.0.1" and dns.getPort() == apple::dns_trampoline_port) { - // macOS is stupid: the default (0.0.0.0) fails with "send failed: Can't assign requested - // address" when unbound tries to connect to the localhost address using a source address - // of 0.0.0.0. Yay apple. + // macOS is stupid: the default (0.0.0.0) fails with "send failed: Can't assign + // requested address" when unbound tries to connect to the localhost address using a + // source address of 0.0.0.0. Yay apple. SetOpt("outgoing-interface:", "127.0.0.1"); // The trampoline expects just a single source port (and sends everything back to it). @@ -387,9 +387,7 @@ namespace llarp::dns if (auto loop_ptr = loop->MaybeGetUVWLoop()) { m_Poller = loop_ptr->resource(ub_fd(m_ctx)); - m_Poller->on([this](auto&, auto&) { - ub_process(m_ctx); - }); + m_Poller->on([this](auto&, auto&) { ub_process(m_ctx); }); m_Poller->start(uvw::PollHandle::Event::READABLE); return; } @@ -408,7 +406,8 @@ namespace llarp::dns if (m_Poller) m_Poller->close(); #endif - if (m_ctx) { + if (m_ctx) + { ::ub_ctx_delete(m_ctx); m_ctx = nullptr; } diff --git a/llarp/dns/server.hpp b/llarp/dns/server.hpp index 17ad38b3d..fcf72111a 100644 --- a/llarp/dns/server.hpp +++ b/llarp/dns/server.hpp @@ -177,13 +177,14 @@ namespace llarp::dns /// reset the resolver state, optionally replace upstream info with new info. The default base /// implementation does nothing. virtual void - ResetResolver([[maybe_unused]] std::optional> replace_upstream = std::nullopt) - { - } + ResetResolver( + [[maybe_unused]] std::optional> replace_upstream = std::nullopt) + {} /// cancel all pending requests and cease further operation. Default operation is a no-op. virtual void - Down(){} + Down() + {} /// attempt to handle a dns message /// returns true if we consumed this query and it should not be processed again diff --git a/llarp/handlers/tun.cpp b/llarp/handlers/tun.cpp index c2446ab1b..89a27437b 100644 --- a/llarp/handlers/tun.cpp +++ b/llarp/handlers/tun.cpp @@ -902,7 +902,8 @@ namespace llarp return true; } - void TunEndpoint::ResetInternalState() + void + TunEndpoint::ResetInternalState() { service::Endpoint::ResetInternalState(); }