merge onion.c changes from new groupchats fork

This commit is contained in:
jfreegman 2021-12-14 13:03:14 -05:00
parent 5c1796d3c4
commit f45807a0f2
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -466,8 +466,9 @@ static int handle_send_2(void *object, IP_Port source, const uint8_t *packet, ui
return 1; return 1;
} }
if (plain[SIZE_IPPORT] != NET_PACKET_ANNOUNCE_REQUEST && const uint8_t packet_id = plain[SIZE_IPPORT];
plain[SIZE_IPPORT] != NET_PACKET_ONION_DATA_REQUEST) {
if (packet_id != NET_PACKET_ANNOUNCE_REQUEST && packet_id != NET_PACKET_ONION_DATA_REQUEST) {
return 1; return 1;
} }
@ -514,8 +515,9 @@ static int handle_recv_3(void *object, IP_Port source, const uint8_t *packet, ui
return 1; return 1;
} }
if (packet[1 + RETURN_3] != NET_PACKET_ANNOUNCE_RESPONSE && const uint8_t packet_id = packet[1 + RETURN_3];
packet[1 + RETURN_3] != NET_PACKET_ONION_DATA_RESPONSE) {
if (packet_id != NET_PACKET_ANNOUNCE_RESPONSE && packet_id != NET_PACKET_ONION_DATA_RESPONSE) {
return 1; return 1;
} }
@ -560,8 +562,9 @@ static int handle_recv_2(void *object, IP_Port source, const uint8_t *packet, ui
return 1; return 1;
} }
if (packet[1 + RETURN_2] != NET_PACKET_ANNOUNCE_RESPONSE && const uint8_t packet_id = packet[1 + RETURN_2];
packet[1 + RETURN_2] != NET_PACKET_ONION_DATA_RESPONSE) {
if (packet_id != NET_PACKET_ANNOUNCE_RESPONSE && packet_id != NET_PACKET_ONION_DATA_RESPONSE) {
return 1; return 1;
} }
@ -606,8 +609,9 @@ static int handle_recv_1(void *object, IP_Port source, const uint8_t *packet, ui
return 1; return 1;
} }
if (packet[1 + RETURN_1] != NET_PACKET_ANNOUNCE_RESPONSE && const uint8_t packet_id = packet[1 + RETURN_1];
packet[1 + RETURN_1] != NET_PACKET_ONION_DATA_RESPONSE) {
if (packet_id != NET_PACKET_ANNOUNCE_RESPONSE && packet_id != NET_PACKET_ONION_DATA_RESPONSE) {
return 1; return 1;
} }