From 2e7496130c2b9d872167e2beed26fe66a60fe47b Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 30 Aug 2019 21:17:34 -0700 Subject: [PATCH] Fix silly thinko in root that harms p2p establishment. --- root/root.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/root/root.cpp b/root/root.cpp index 0e77f9f8a..a9b8a2991 100644 --- a/root/root.cpp +++ b/root/root.cpp @@ -431,7 +431,7 @@ static void handlePacket(const int v4s,const int v6s,const InetAddress *const ip outp.append((uint8_t)16); outp.append((const uint8_t *)b->second->ip6.rawIpData(),16); outp.armor((*a)->key,true); - sendto(v6s,pkt.data(),pkt.size(),SENDTO_FLAGS,(const struct sockaddr *)&((*a)->ip6),(socklen_t)sizeof(struct sockaddr_in6)); + sendto(v6s,outp.data(),outp.size(),SENDTO_FLAGS,(const struct sockaddr *)&((*a)->ip6),(socklen_t)sizeof(struct sockaddr_in6)); (*a)->lastSend = now; // Introduce destination to source (V6) @@ -442,7 +442,7 @@ static void handlePacket(const int v4s,const int v6s,const InetAddress *const ip outp.append((uint8_t)16); outp.append((const uint8_t *)ip->rawIpData(),16); outp.armor(b->second->key,true); - sendto(v6s,pkt.data(),pkt.size(),SENDTO_FLAGS,(const struct sockaddr *)&(b->second->ip6),(socklen_t)sizeof(struct sockaddr_in6)); + sendto(v6s,outp.data(),outp.size(),SENDTO_FLAGS,(const struct sockaddr *)&(b->second->ip6),(socklen_t)sizeof(struct sockaddr_in6)); b->second->lastSend = now; } if (((*a)->ip4)&&(b->second->ip4)) { @@ -456,7 +456,7 @@ static void handlePacket(const int v4s,const int v6s,const InetAddress *const ip outp.append((uint8_t)4); outp.append((const uint8_t *)b->second->ip4.rawIpData(),4); outp.armor((*a)->key,true); - sendto(v4s,pkt.data(),pkt.size(),SENDTO_FLAGS,(const struct sockaddr *)&((*a)->ip4),(socklen_t)sizeof(struct sockaddr_in)); + sendto(v4s,outp.data(),outp.size(),SENDTO_FLAGS,(const struct sockaddr *)&((*a)->ip4),(socklen_t)sizeof(struct sockaddr_in)); (*a)->lastSend = now; // Introduce destination to source (V4) @@ -467,7 +467,7 @@ static void handlePacket(const int v4s,const int v6s,const InetAddress *const ip outp.append((uint8_t)4); outp.append((const uint8_t *)ip->rawIpData(),4); outp.armor(b->second->key,true); - sendto(v4s,pkt.data(),pkt.size(),SENDTO_FLAGS,(const struct sockaddr *)&(b->second->ip4),(socklen_t)sizeof(struct sockaddr_in)); + sendto(v4s,outp.data(),outp.size(),SENDTO_FLAGS,(const struct sockaddr *)&(b->second->ip4),(socklen_t)sizeof(struct sockaddr_in)); b->second->lastSend = now; } }