Skip to content

Commit

Permalink
quic: fix Identification field being always 0
Browse files Browse the repository at this point in the history
Fixes a classic C typo with (*ptr++) syntax.
The bug resulted in all Firedancer QUIC packets having an IPv4 ID
field of 0.  Most Internet peers (most notably Linux) are resilient
enough to handle this.  Should be fixed nonetheless.
  • Loading branch information
riptl authored and ripatel-fd committed Dec 30, 2024
1 parent 4841969 commit 52fcc87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/waltz/quic/fd_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,7 @@ fd_quic_tx_buffered_raw(
pkt.ip4->verihl = FD_IP4_VERIHL(4,5);
pkt.ip4->tos = (uchar)(config->net.dscp << 2); /* could make this per-connection or per-stream */
pkt.ip4->net_tot_len = (ushort)( 20 + 8 + payload_sz );
pkt.ip4->net_id = *ipv4_id++;
pkt.ip4->net_id = *ipv4_id;
pkt.ip4->net_frag_off = 0x4000u; /* don't fragment */
pkt.ip4->ttl = 64; /* TODO make configurable */
pkt.ip4->protocol = FD_IP4_HDR_PROTOCOL_UDP;
Expand All @@ -2960,6 +2960,7 @@ fd_quic_tx_buffered_raw(
pkt.udp->net_dport = dst_udp_port;
pkt.udp->net_len = (ushort)( 8 + payload_sz );
pkt.udp->check = 0x0000;
*ipv4_id = (ushort)( *ipv4_id + 1 );

/* TODO saddr could be zero -- should use the kernel routing table to
determine an appropriate source address */
Expand Down

0 comments on commit 52fcc87

Please sign in to comment.