mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Build fix
This commit is contained in:
parent
8a9669f130
commit
105023bd87
3 changed files with 5 additions and 4 deletions
|
@ -531,6 +531,7 @@ func (n *Node) AddStaticRoot(id *Identity, addrs []InetAddress) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(saddrs) > 0 {
|
if len(saddrs) > 0 {
|
||||||
|
n.log.Printf("adding or updating static root %s at address(es) %s", id.String(), straddrs)
|
||||||
ids := C.CString(id.String())
|
ids := C.CString(id.String())
|
||||||
C.ZT_Node_setStaticRoot(unsafe.Pointer(n.zn), ids, &saddrs[0], C.uint(len(saddrs)))
|
C.ZT_Node_setStaticRoot(unsafe.Pointer(n.zn), ids, &saddrs[0], C.uint(len(saddrs)))
|
||||||
C.free(unsafe.Pointer(ids))
|
C.free(unsafe.Pointer(ids))
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
#include "RingBuffer.hpp"
|
#include "RingBuffer.hpp"
|
||||||
#include "Packet.hpp"
|
#include "Packet.hpp"
|
||||||
|
|
||||||
#include "../osdep/Phy.hpp"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum return value of preferenceRank()
|
* Maximum return value of preferenceRank()
|
||||||
*/
|
*/
|
||||||
|
@ -46,7 +44,6 @@ class RuntimeEnvironment;
|
||||||
class Path
|
class Path
|
||||||
{
|
{
|
||||||
friend class SharedPtr<Path>;
|
friend class SharedPtr<Path>;
|
||||||
Phy<Path *> *_phy;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -144,7 +141,8 @@ public:
|
||||||
memset(_ifname, 0, 16);
|
memset(_ifname, 0, 16);
|
||||||
memset(_addrString, 0, sizeof(_addrString));
|
memset(_addrString, 0, sizeof(_addrString));
|
||||||
if (_localSocket != -1) {
|
if (_localSocket != -1) {
|
||||||
_phy->getIfName((PhySocket *) ((uintptr_t) _localSocket), _ifname, 16);
|
// TODO: add localInterface alongside localSocket
|
||||||
|
//_phy->getIfName((PhySocket *) ((uintptr_t) _localSocket), _ifname, 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,12 +64,14 @@ public:
|
||||||
const char *const dnp = (dn.length() > 0) ? dn.c_str() : (const char *)0;
|
const char *const dnp = (dn.length() > 0) ? dn.c_str() : (const char *)0;
|
||||||
std::lock_guard<std::mutex> l(_managedRoutes_l);
|
std::lock_guard<std::mutex> l(_managedRoutes_l);
|
||||||
_managedRoutes[std::pair<InetAddress,unsigned int>(target,metric)] = std::shared_ptr<ManagedRoute>(new ManagedRoute(target,via,dnp));
|
_managedRoutes[std::pair<InetAddress,unsigned int>(target,metric)] = std::shared_ptr<ManagedRoute>(new ManagedRoute(target,via,dnp));
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZT_ALWAYS_INLINE int removeRoute(const InetAddress &target,const InetAddress &via,const unsigned int metric)
|
ZT_ALWAYS_INLINE int removeRoute(const InetAddress &target,const InetAddress &via,const unsigned int metric)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> l(_managedRoutes_l);
|
std::lock_guard<std::mutex> l(_managedRoutes_l);
|
||||||
_managedRoutes.erase(std::pair<InetAddress,unsigned int>(target,metric));
|
_managedRoutes.erase(std::pair<InetAddress,unsigned int>(target,metric));
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZT_ALWAYS_INLINE int syncRoutes()
|
ZT_ALWAYS_INLINE int syncRoutes()
|
||||||
|
|
Loading…
Add table
Reference in a new issue