Missing ; and wrong name in threading lock macros
This commit is contained in:
parent
ad465d6703
commit
64078ee051
2 changed files with 6 additions and 6 deletions
|
@ -288,7 +288,7 @@ bool WireguardProcessor::HandleIcmpv6NeighborSolicitation(const byte *data, size
|
||||||
// Target address must match a peer's range.
|
// Target address must match a peer's range.
|
||||||
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
WgPeer *peer = (WgPeer*)dev_.ip_to_peer_map().LookupV6(data + 48);
|
WgPeer *peer = (WgPeer*)dev_.ip_to_peer_map().LookupV6(data + 48);
|
||||||
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_)
|
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
if (peer == NULL)
|
if (peer == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ void WireguardProcessor::HandleTunPacket(Packet *packet) {
|
||||||
uint32 ip = ReadBE32(data + 16);
|
uint32 ip = ReadBE32(data + 16);
|
||||||
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
peer = (WgPeer*)dev_.ip_to_peer_map().LookupV4(ip);
|
peer = (WgPeer*)dev_.ip_to_peer_map().LookupV4(ip);
|
||||||
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_)
|
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
if (peer == NULL)
|
if (peer == NULL)
|
||||||
goto getout;
|
goto getout;
|
||||||
if ((ip >= (224 << 24) || ip == peer->ipv4_broadcast_addr_) && !peer->allow_multicast_through_peer_)
|
if ((ip >= (224 << 24) || ip == peer->ipv4_broadcast_addr_) && !peer->allow_multicast_through_peer_)
|
||||||
|
@ -371,7 +371,7 @@ void WireguardProcessor::HandleTunPacket(Packet *packet) {
|
||||||
|
|
||||||
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
peer = (WgPeer*)dev_.ip_to_peer_map().LookupV6(data + 24);
|
peer = (WgPeer*)dev_.ip_to_peer_map().LookupV6(data + 24);
|
||||||
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_)
|
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
if (peer == NULL)
|
if (peer == NULL)
|
||||||
goto getout;
|
goto getout;
|
||||||
|
|
||||||
|
@ -929,7 +929,7 @@ void WireguardProcessor::HandleAuthenticatedDataPacket_WillUnlock(WgKeypair *key
|
||||||
goto getout_error_header;
|
goto getout_error_header;
|
||||||
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
peer_from_header = (WgPeer*)dev_.ip_to_peer_map().LookupV4(ReadBE32(data + 12));
|
peer_from_header = (WgPeer*)dev_.ip_to_peer_map().LookupV4(ReadBE32(data + 12));
|
||||||
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_)
|
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
size_from_header = ReadBE16(data + 2);
|
size_from_header = ReadBE16(data + 2);
|
||||||
if (size_from_header < IPV4_HEADER_SIZE) {
|
if (size_from_header < IPV4_HEADER_SIZE) {
|
||||||
// too small packet?
|
// too small packet?
|
||||||
|
@ -940,7 +940,7 @@ void WireguardProcessor::HandleAuthenticatedDataPacket_WillUnlock(WgKeypair *key
|
||||||
goto getout_error_header;
|
goto getout_error_header;
|
||||||
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
WG_ACQUIRE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
peer_from_header = (WgPeer*)dev_.ip_to_peer_map().LookupV6(data + 8);
|
peer_from_header = (WgPeer*)dev_.ip_to_peer_map().LookupV6(data + 8);
|
||||||
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_)
|
WG_RELEASE_RWLOCK_SHARED(dev_.ip_to_peer_map_lock_);
|
||||||
size_from_header = IPV6_HEADER_SIZE + ReadBE16(data + 4);
|
size_from_header = IPV6_HEADER_SIZE + ReadBE16(data + 4);
|
||||||
} else {
|
} else {
|
||||||
// invalid ip version
|
// invalid ip version
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
// Threading macros that enable locks only in MT builds
|
// Threading macros that enable locks only in MT builds
|
||||||
#if WITH_WG_THREADING
|
#if WITH_WG_THREADING
|
||||||
#define WG_SCOPED_LOCK(name) AutoLock scoped_lock(&name)
|
#define WG_SCOPED_LOCK(name) ScopedLock scoped_lock(&name)
|
||||||
#define WG_ACQUIRE_LOCK(name) name.Acquire()
|
#define WG_ACQUIRE_LOCK(name) name.Acquire()
|
||||||
#define WG_RELEASE_LOCK(name) name.Release()
|
#define WG_RELEASE_LOCK(name) name.Release()
|
||||||
#define WG_DECLARE_LOCK(name) Mutex name;
|
#define WG_DECLARE_LOCK(name) Mutex name;
|
||||||
|
|
Loading…
Reference in a new issue