Merge remote-tracking branch 'origin/master' into iwp-multi-ack

pull/830/head
Jeff Becker 5 years ago
commit da6a3bf9bb
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -2,7 +2,7 @@
#define LLARP_VERSION_HPP
#if defined(_WIN32) && defined(RC_INVOKED)
#define LLARP_VERSION 0, 5, 0, 0
#define LLARP_VERSION 0, 5, 1, 0
#else
#ifndef LLARP_VERSION_MAJ
@ -14,7 +14,7 @@
#endif
#ifndef LLARP_VERSION_PATCH
#define LLARP_VERSION_PATCH "0"
#define LLARP_VERSION_PATCH "1"
#endif
#ifndef LLARP_VERSION_NUM

@ -193,6 +193,21 @@ namespace llarp
return nodes.find(key) != nodes.end();
}
// remove all nodes who's key matches a predicate
template < typename Predicate >
void
RemoveIf(Predicate pred)
{
auto itr = nodes.begin();
while(itr != nodes.end())
{
if(pred(itr->first))
itr = nodes.erase(itr);
else
++itr;
}
}
void
Clear()
{

@ -92,7 +92,6 @@ llarp_ev_udp_sendto(struct llarp_udp_io *udp, const sockaddr *to,
bool
llarp_ev_add_tun(struct llarp_ev_loop *loop, struct llarp_tun_io *tun)
{
#if !defined(_WIN32)
if(tun->ifaddr[0] == 0 || strcmp(tun->ifaddr, "auto") == 0)
{
LogError("invalid ifaddr on tun: ", tun->ifaddr);
@ -103,6 +102,7 @@ llarp_ev_add_tun(struct llarp_ev_loop *loop, struct llarp_tun_io *tun)
LogError("invalid ifname on tun: ", tun->ifname);
return false;
}
#if !defined(_WIN32)
return loop->tun_listen(tun);
#else
UNREFERENCED_PARAMETER(loop);

@ -870,10 +870,10 @@ namespace llarp
net::IPPacket::ExpandV4(xntohl(ifmask))});
}
});
// try 10.x.0.0/16
byte_t oct = 0;
while(oct < 255)
{
// TODO: check for range inbetween these
const huint32_t loaddr = ipaddr_ipv4_bits(10, oct, 0, 1);
const huint32_t hiaddr = ipaddr_ipv4_bits(10, oct, 255, 255);
bool hit = false;
@ -885,6 +885,38 @@ namespace llarp
return loaddr.ToString() + "/16";
++oct;
}
// try 192.168.x.0/24
oct = 0;
while(oct < 255)
{
const huint32_t loaddr = ipaddr_ipv4_bits(192, 168, oct, 1);
const huint32_t hiaddr = ipaddr_ipv4_bits(192, 168, oct, 255);
bool hit = false;
for(const auto& range : currentRanges)
{
hit = hit || range.ContainsV4(loaddr) || range.ContainsV4(hiaddr);
}
if(!hit)
return loaddr.ToString() + "/24";
}
// try 172.16.x.0/24
oct = 0;
while(oct < 255)
{
const huint32_t loaddr = ipaddr_ipv4_bits(172, 16, oct, 1);
const huint32_t hiaddr = ipaddr_ipv4_bits(172, 16, oct, 255);
bool hit = false;
for(const auto& range : currentRanges)
{
hit = hit || range.ContainsV4(loaddr) || range.ContainsV4(hiaddr);
}
if(!hit)
return loaddr.ToString() + "/24";
++oct;
}
LogError(
"cannot autodetect any free ip ranges on your system for use, please "
"configure this manually");
return "";
}

@ -360,7 +360,8 @@ namespace llarp
Router::FromConfig(Config *conf)
{
// Set netid before anything else
if(!conf->router.netId().empty())
if(!conf->router.netId().empty()
&& strcmp(conf->router.netId().c_str(), Version::LLARP_NET_ID))
{
const auto &netid = conf->router.netId();
llarp::LogWarn("!!!! you have manually set netid to be '", netid,
@ -729,6 +730,18 @@ namespace llarp
diskworker()->addJob(
[&]() { routerProfiling().Save(routerProfilesFile.c_str()); });
}
// get connected peers
std::set< dht::Key_t > peersWeHave;
_linkManager.ForEachPeer([&peersWeHave](ILinkSession *s) {
if(!s->IsEstablished())
return;
peersWeHave.emplace(s->GetPubKey());
});
// remove any nodes we don't have connections to
_dht->impl->Nodes()->RemoveIf([&peersWeHave](const dht::Key_t &k) -> bool {
return peersWeHave.count(k) == 0;
});
} // namespace llarp
bool
@ -814,7 +827,9 @@ namespace llarp
auto found = netConfig.find(itr->first);
if(found == netConfig.end() || found->second.empty())
{
netConfig.emplace(itr->first, itr->second());
auto val = itr->second();
if(!val.empty())
netConfig.emplace(itr->first, std::move(val));
}
++itr;
}
@ -1185,7 +1200,7 @@ namespace llarp
}
else
{
LogWarn("Message failed sending to ", remote);
LogDebug("Message failed sending to ", remote);
}
}
} // namespace llarp

@ -250,7 +250,9 @@ namespace llarp
bool
RouterContact::IsExpired(llarp_time_t now) const
{
return Age(now) >= Lifetime;
(void)now;
return false;
// return Age(now) >= Lifetime;
}
llarp_time_t

@ -81,18 +81,18 @@ BEGIN
VALUE "CompanyName", "Loki Foundation"
VALUE "FileDescription", "LokiNET for Microsoft® Windows® NT™"
#ifdef LLARP_RELEASE_MOTTO
VALUE "FileVersion", VERSION_STRING(0.5.0, RELEASE_MOTTO, GIT_REV)
VALUE "FileVersion", VERSION_STRING(0.5.1, RELEASE_MOTTO, GIT_REV)
#else
VALUE "FileVersion", VERSION_STRING(0.5.0-dev-, GIT_REV)
VALUE "FileVersion", VERSION_STRING(0.5.1-dev-, GIT_REV)
#endif
VALUE "InternalName", "llarpd"
VALUE "LegalCopyright", "Copyright ©2018-2019 Jeff Becker, Rick V for the Loki Foundation. All rights reserved. This software is provided under the terms of the zlib-libpng licence; see the file LICENSE for details."
VALUE "OriginalFilename", "abyss-main.exe"
VALUE "ProductName", "LokiNET for Windows"
#ifdef LLARP_RELEASE_MOTTO
VALUE "ProductVersion", VERSION_STRING(0.5.0, RELEASE_MOTTO, GIT_REV)
VALUE "ProductVersion", VERSION_STRING(0.5.1, RELEASE_MOTTO, GIT_REV)
#else
VALUE "ProductVersion", VERSION_STRING(0.5.0-dev-, GIT_REV)
VALUE "ProductVersion", VERSION_STRING(0.5.1-dev-, GIT_REV)
#endif
END
END

@ -10,7 +10,7 @@
<conclusion file="conclusion.html" mime-type="text/html" />
<!-- List all component packages -->
<pkg-ref id="network.loki.lokinet"
version="0.4"
version="0.5"
auth="root">lokinet.pkg</pkg-ref>
<!-- List them again here. They can now be organized
as a hierarchy if you want. -->
@ -21,7 +21,7 @@
<choice
id="network.loki.lokinet"
visible="false"
title="LokiNET"
title="Lokinet"
description='Lokinet is a free, open source, private, decentralized, \"market based sybil resistant\" and IP based onion routing network'
start_selected="true">
<pkg-ref id="network.loki.lokinet"/>

@ -3,7 +3,10 @@ VERSION=$1
echo "Copying latest build"
mkdir -p osx-pkg/usr/local/bin
mkdir osx-pkg/usr/local/lib
cp ../lokinet osx-pkg/usr/local/bin
echo "Copying /usr/local/lib/libuv.dylib into package"
cp /usr/local/lib/libuv.dylib osx-pkg/usr/local/lib
# just incase they want to switch networks later
cp ../lokinet-bootstrap osx-pkg/usr/local/bin

@ -1,3 +1,3 @@
IRC or Discord is likely the best place for help with Lokinet
IRC, Discord, or Loki Messenger is likely the best place for help with Lokinet
IRC: #llarp on irc.freenode.org
IRC Address: #llarp on irc.freenode.org

@ -1,7 +1,7 @@
Hi, welcome to Lokinet public alpha!
Hi, welcome to Lokinet public beta!
Lokinet is a private, decentralized and Market based, Sybil resistant overlay network for the internet.
This package contains the reference implementation of LLARP.
This software is in a very early stage where there's much work to be done.
This software is in its early stages, please do not use it for anything mission critical, by default you are using the betanet which is mostly run by node operators from the Loki team.

@ -10,7 +10,7 @@ rm $HOME/.lokinet/*.key >> /tmp/lokinet_postinstall.log
rm $HOME/.lokinet/*.private >> /tmp/lokinet_postinstall.log
rm -fr $HOME/.lokinet/netdb >> /tmp/lokinet_postinstall.log
url="https://i2p.rocks/i2procks.signed"
url="https://seed.lokinet.org/bootstrap.signed"
echo "downloading $url" >> /tmp/lokinet_postinstall.log
echo "to $HOME/.lokinet/bootstrap.signed" >> /tmp/lokinet_postinstall.log

Loading…
Cancel
Save