Commit 330dd1b
committed
[~] fix issue #581: reject coalesced packets with mismatched DCID per RFC 9000 12.2
The receive path in xqc_conn_process_packet walks every QUIC packet inside
a single UDP datagram but never compares the Destination Connection ID of
the second-and-later packets against the first one. RFC 9000 Section 12.2
requires receivers to ignore those mismatching follow-up packets while
still processing the rest of the datagram; without that check a peer that
holds more than one valid SCID for the connection can sneak frames in
under a different CID once handshake is past, and during handshake the
long header path skips the connection-level DCID set entirely for INIT
and 0-RTT.
Anchor the datagram on the DCID of its first successfully parsed packet
and drop any subsequent packet whose pi_pkt.pkt_dcid does not match,
emitting a WARN log plus a TRA_PACKET_DROPPED qlog event and bumping
packet_dropped_count. The rest of the datagram keeps flowing.
Coverage: tests/unittest/xqc_coalesced_test.c adds five CUnit cases that
build coalesced Initials with controlled DCIDs and assert single-packet,
match, mismatch, length-mismatch, and A+B+A patterns.
Fixes: #5811 parent 0e70499 commit 330dd1b
5 files changed
Lines changed: 550 additions & 2 deletions
File tree
- src/transport
- tests
- unittest
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5012 | 5012 | | |
5013 | 5013 | | |
5014 | 5014 | | |
5015 | | - | |
| 5015 | + | |
5016 | 5016 | | |
5017 | 5017 | | |
5018 | 5018 | | |
| |||
5022 | 5022 | | |
5023 | 5023 | | |
5024 | 5024 | | |
| 5025 | + | |
| 5026 | + | |
| 5027 | + | |
| 5028 | + | |
| 5029 | + | |
| 5030 | + | |
| 5031 | + | |
| 5032 | + | |
| 5033 | + | |
| 5034 | + | |
| 5035 | + | |
5025 | 5036 | | |
5026 | 5037 | | |
5027 | 5038 | | |
| |||
5039 | 5050 | | |
5040 | 5051 | | |
5041 | 5052 | | |
| 5053 | + | |
| 5054 | + | |
| 5055 | + | |
| 5056 | + | |
| 5057 | + | |
| 5058 | + | |
| 5059 | + | |
| 5060 | + | |
| 5061 | + | |
| 5062 | + | |
| 5063 | + | |
| 5064 | + | |
| 5065 | + | |
| 5066 | + | |
| 5067 | + | |
| 5068 | + | |
| 5069 | + | |
| 5070 | + | |
| 5071 | + | |
| 5072 | + | |
| 5073 | + | |
| 5074 | + | |
| 5075 | + | |
| 5076 | + | |
| 5077 | + | |
| 5078 | + | |
| 5079 | + | |
| 5080 | + | |
| 5081 | + | |
| 5082 | + | |
| 5083 | + | |
| 5084 | + | |
| 5085 | + | |
| 5086 | + | |
| 5087 | + | |
| 5088 | + | |
| 5089 | + | |
| 5090 | + | |
5042 | 5091 | | |
5043 | 5092 | | |
5044 | 5093 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
130 | 136 | | |
131 | 137 | | |
132 | 138 | | |
| |||
0 commit comments