This commit is contained in:
Adam Ierymenko 2019-08-28 15:22:28 -07:00
parent 933404b1dd
commit ef12c5af99
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3

View file

@ -436,11 +436,14 @@ int main(int argc,char **argv)
socklen_t sl = sizeof(in6); socklen_t sl = sizeof(in6);
const int pl = (int)recvfrom(s6,pkt.unsafeData(),pkt.capacity(),0,(struct sockaddr *)&in6,&sl); const int pl = (int)recvfrom(s6,pkt.unsafeData(),pkt.capacity(),0,(struct sockaddr *)&in6,&sl);
if (pl > 0) { if (pl > 0) {
try { if (pl >= ZT_PROTO_MIN_FRAGMENT_LENGTH) {
pkt.setSize((unsigned int)pl); try {
handlePacket(s6,reinterpret_cast<const InetAddress *>(&in6),pkt); pkt.setSize((unsigned int)pl);
} catch ( ... ) { handlePacket(s6,reinterpret_cast<const InetAddress *>(&in6),pkt);
printf("* unexpected exception" ZT_EOL_S); } catch ( ... ) {
char ipstr[128];
printf("* unexpected exception handling packet from %s" ZT_EOL_S,reinterpret_cast<const InetAddress *>(&in6)->toString(ipstr));
}
} }
} else { } else {
break; break;
@ -456,11 +459,14 @@ int main(int argc,char **argv)
socklen_t sl = sizeof(in4); socklen_t sl = sizeof(in4);
const int pl = (int)recvfrom(s4,pkt.unsafeData(),pkt.capacity(),0,(struct sockaddr *)&in4,&sl); const int pl = (int)recvfrom(s4,pkt.unsafeData(),pkt.capacity(),0,(struct sockaddr *)&in4,&sl);
if (pl > 0) { if (pl > 0) {
try { if (pl >= ZT_PROTO_MIN_FRAGMENT_LENGTH) {
pkt.setSize((unsigned int)pl); try {
handlePacket(s4,reinterpret_cast<const InetAddress *>(&in4),pkt); pkt.setSize((unsigned int)pl);
} catch ( ... ) { handlePacket(s4,reinterpret_cast<const InetAddress *>(&in4),pkt);
printf("* unexpected exception" ZT_EOL_S); } catch ( ... ) {
char ipstr[128];
printf("* unexpected exception handling packet from %s" ZT_EOL_S,reinterpret_cast<const InetAddress *>(&in4)->toString(ipstr));
}
} }
} else { } else {
break; break;