mirror of https://github.com/oxen-io/lokinet
fix exit address
This commit is contained in:
parent
20e398b684
commit
dfa00e3415
|
@ -1004,10 +1004,10 @@ namespace llarp
|
|||
}
|
||||
|
||||
bool
|
||||
IsBogonRange(const in6_addr&, const in6_addr&)
|
||||
IsBogonRange(const in6_addr& host, const in6_addr&)
|
||||
{
|
||||
// TODO: implement me
|
||||
return false;
|
||||
return IsBogon(host);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -1404,6 +1404,9 @@ namespace llarp
|
|||
|
||||
LogInfo("You have ", inboundLinks.size(), " inbound links");
|
||||
|
||||
// set public signing key
|
||||
_rc.pubkey = seckey_topublic(identity());
|
||||
|
||||
AddressInfo ai;
|
||||
for(const auto &link : inboundLinks)
|
||||
{
|
||||
|
@ -1418,23 +1421,23 @@ namespace llarp
|
|||
if(IsBogon(ai.ip))
|
||||
continue;
|
||||
_rc.addrs.push_back(ai);
|
||||
if(ExitEnabled())
|
||||
{
|
||||
const llarp::Addr addr(ai);
|
||||
const nuint32_t a{htonl(addr.addr4()->s_addr)};
|
||||
_rc.exits.emplace_back(_rc.pubkey, a);
|
||||
LogInfo(
|
||||
"Neato teh l33toh, You are a freaking exit relay. w00t!!!!! your "
|
||||
"exit "
|
||||
"is advertised as exiting at ",
|
||||
a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set public encryption key
|
||||
_rc.enckey = seckey_topublic(encryption());
|
||||
// set public signing key
|
||||
_rc.pubkey = seckey_topublic(identity());
|
||||
if(ExitEnabled())
|
||||
{
|
||||
nuint32_t a = publicAddr.xtonl();
|
||||
_rc.exits.emplace_back(_rc.pubkey, a);
|
||||
LogInfo(
|
||||
"Neato teh l33toh, You are a freaking exit relay. w00t!!!!! your "
|
||||
"exit "
|
||||
"is advertised as exiting at ",
|
||||
a);
|
||||
}
|
||||
|
||||
LogInfo("Signing rc...");
|
||||
if(!_rc.Sign(crypto(), identity()))
|
||||
{
|
||||
|
|
|
@ -134,7 +134,9 @@ namespace llarp
|
|||
msg->from = from;
|
||||
result = msg->HandleMessage(h, r);
|
||||
if(!result)
|
||||
{
|
||||
llarp::LogWarn("Failed to handle inbound routing message ", key);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue