1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
This commit is contained in:
Jeff Becker 2018-11-14 16:47:58 -05:00
parent fa1333b13b
commit b462090e9c
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05

View file

@ -420,11 +420,11 @@ namespace llarp
} }
huint32_t huint32_t
TunEndpoint::ObtainIPForAddr(const byte_t *addr) TunEndpoint::ObtainIPForAddr(const byte_t *a)
{ {
llarp_time_t now = Now(); llarp_time_t now = Now();
huint32_t nextIP = {0}; huint32_t nextIP = {0};
AlignedBuffer< 32 > ident(addr); AlignedBuffer< 32 > ident(a);
{ {
// previously allocated address // previously allocated address
auto itr = m_AddrToIP.find(ident); auto itr = m_AddrToIP.find(ident);
@ -473,8 +473,8 @@ namespace llarp
++itr; ++itr;
} }
// remap address // remap address
m_IPToAddr[oldest.first] = addr; m_IPToAddr[oldest.first] = ident;
m_AddrToIP[addr] = oldest.first; m_AddrToIP[ident] = oldest.first;
nextIP = oldest.first; nextIP = oldest.first;
// mark ip active // mark ip active