Browse Source
Merge pull request #300 from Logan007/fixChk
enabled packet checksum
pull/306/head
Luca Deri
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
6 additions and
6 deletions
-
src/edge_utils.c
-
src/sn.c
-
src/sn_utils.c
|
@ -1662,8 +1662,8 @@ static void readFromIPSocket(n2n_edge_t * eee, int in_sock) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (checksum != pearson_hash_16 (udp_buf, recvlen)) { |
|
|
if (checksum != pearson_hash_16 (udp_buf, recvlen)) { |
|
|
// !!! traceEvent(TRACE_DEBUG, "readFromIPSocket dropped packet due to checksum error.");
|
|
|
traceEvent(TRACE_DEBUG, "readFromIPSocket dropped packet due to checksum error."); |
|
|
// !!! return;
|
|
|
return; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
@ -495,8 +495,8 @@ static int process_udp(n2n_sn_t * sss, |
|
|
if ( (ret = packet_header_decrypt (udp_buf, udp_size, comm->community, comm->header_encryption_ctx, |
|
|
if ( (ret = packet_header_decrypt (udp_buf, udp_size, comm->community, comm->header_encryption_ctx, |
|
|
comm->header_iv_ctx, &checksum)) ) { |
|
|
comm->header_iv_ctx, &checksum)) ) { |
|
|
if (checksum != pearson_hash_16 (udp_buf, udp_size)) { |
|
|
if (checksum != pearson_hash_16 (udp_buf, udp_size)) { |
|
|
// !!! traceEvent(TRACE_DEBUG, "process_udp dropped packet due to checksum error.");
|
|
|
traceEvent(TRACE_DEBUG, "process_udp dropped packet due to checksum error."); |
|
|
// !!! return -1;
|
|
|
return -1; |
|
|
} |
|
|
} |
|
|
if (comm->header_encryption == HEADER_ENCRYPTION_UNKNOWN) { |
|
|
if (comm->header_encryption == HEADER_ENCRYPTION_UNKNOWN) { |
|
|
traceEvent (TRACE_INFO, "process_udp locked community '%s' to using " |
|
|
traceEvent (TRACE_INFO, "process_udp locked community '%s' to using " |
|
|
|
@ -424,8 +424,8 @@ static int process_udp(n2n_sn_t * sss, |
|
|
if ( (ret = packet_header_decrypt (udp_buf, udp_size, comm->community, comm->header_encryption_ctx, |
|
|
if ( (ret = packet_header_decrypt (udp_buf, udp_size, comm->community, comm->header_encryption_ctx, |
|
|
comm->header_iv_ctx, &checksum)) ) { |
|
|
comm->header_iv_ctx, &checksum)) ) { |
|
|
if (checksum != pearson_hash_16 (udp_buf, udp_size)) { |
|
|
if (checksum != pearson_hash_16 (udp_buf, udp_size)) { |
|
|
// !!! traceEvent(TRACE_DEBUG, "process_udp dropped packet due to checksum error.");
|
|
|
traceEvent(TRACE_DEBUG, "process_udp dropped packet due to checksum error."); |
|
|
// !!! return -1;
|
|
|
return -1; |
|
|
} |
|
|
} |
|
|
if (comm->header_encryption == HEADER_ENCRYPTION_UNKNOWN) { |
|
|
if (comm->header_encryption == HEADER_ENCRYPTION_UNKNOWN) { |
|
|
traceEvent (TRACE_INFO, "process_udp locked community '%s' to using " |
|
|
traceEvent (TRACE_INFO, "process_udp locked community '%s' to using " |
|
|