Merge pull request #254 from neuroscr/master

Another grab bag of small tweaks/fixes
This commit is contained in:
Ryan Tharp 2019-01-29 03:16:14 -08:00 committed by GitHub
commit 0eb105bef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,8 @@
#!/bin/sh
# copy a lokinet binary into this cluster
cp ../../lokinet .
# generate default config file
../../lokinet -g lokinet.ini
./lokinet -g lokinet.ini
# make seed node
./makenode.sh 1
# establish bootstrap

View File

@ -149,7 +149,8 @@ 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(strcmp(tun->ifaddr, "") == 0 || strcmp(tun->ifaddr, "auto"))
// llarp::LogInfo("ev creating tunnel ", tun->ifaddr, " on ", tun->ifname);
if(strcmp(tun->ifaddr, "") == 0 || strcmp(tun->ifaddr, "auto") == 0)
{
std::string ifaddr = llarp::findFreePrivateRange();
auto pos = ifaddr.find("/");
@ -176,7 +177,7 @@ llarp_ev_add_tun(struct llarp_ev_loop *loop, struct llarp_tun_io *tun)
tun->ifaddr);
llarp::LogInfo("IfAddr autodetect: ", tun->ifaddr, "/", tun->netmask);
}
if(strcmp(tun->ifname, "") == 0 || strcmp(tun->ifname, "auto"))
if(strcmp(tun->ifname, "") == 0 || strcmp(tun->ifname, "auto") == 0)
{
std::string ifname = llarp::findFreeLokiTunIfName();
std::copy_n(ifname.begin(), std::min(sizeof(tun->ifname), ifname.size()),

View File

@ -337,7 +337,7 @@ namespace llarp
return false;
}
f.seekg(0, std::ios::end);
auto l = f.tellg();
size_t l = f.tellg();
if(l > sizeof(tmp))
return false;
f.seekg(0, std::ios::beg);

View File

@ -35,10 +35,10 @@ TEST_P(PubKeyString, fromstring)
}
llarp::PubKey::Data empty = {};
llarp::PubKey::Data full = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
llarp::PubKey::Data full = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
// clang-format off
ToStringData toStringData[] = {