From 52fcc87c41d91674bd2d16b365d62157b0a5cb25 Mon Sep 17 00:00:00 2001 From: Richard Patel Date: Mon, 30 Dec 2024 06:40:41 +0000 Subject: [PATCH] quic: fix Identification field being always 0 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. --- src/waltz/quic/fd_quic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/waltz/quic/fd_quic.c b/src/waltz/quic/fd_quic.c index 6dbeeed93a..e91ac9ddd4 100644 --- a/src/waltz/quic/fd_quic.c +++ b/src/waltz/quic/fd_quic.c @@ -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; @@ -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 */