Skip to content

Commit

Permalink
Extend use_zero_crc check to AF_CONN sockets (#690)
Browse files Browse the repository at this point in the history
The `use_zero_crc` flag is already considered for AF_INET address family.
This commit ensures that when transmitting using sockets created with the
AF_CONN address family, crc32c calculation is skipped based on this flag.
  • Loading branch information
melpon committed Nov 5, 2023
1 parent 308006e commit 2952e93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion usrsctplib/netinet/sctp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -5023,7 +5023,9 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
sctphdr->dest_port = dest_port;
sctphdr->v_tag = v_tag;
sctphdr->checksum = 0;
if (SCTP_BASE_VAR(crc32c_offloaded) == 0) {
if (use_zero_crc) {
SCTP_STAT_INCR(sctps_sendzerocrc);
} else if (SCTP_BASE_VAR(crc32c_offloaded) == 0) {
sctphdr->checksum = sctp_calculate_cksum(m, 0);
SCTP_STAT_INCR(sctps_sendswcrc);
} else {
Expand Down

0 comments on commit 2952e93

Please sign in to comment.