Skip to content

fix: decode ECN codepoint 0b11 as CongestionExperienced - #1

Closed
thomaseizinger wants to merge 4 commits into
mainfrom
claude/ip-packet-ingot-refactor-3wzbin
Closed

fix: decode ECN codepoint 0b11 as CongestionExperienced#1
thomaseizinger wants to merge 4 commits into
mainfrom
claude/ip-packet-ingot-refactor-3wzbin

Conversation

@thomaseizinger

Copy link
Copy Markdown
Member

The Ecn decoders folded the CE (Congestion Experienced, 0b11) codepoint into Capable0, so a CE-marked packet re-serialised as ECT(1) and the congestion signal was lost. Decoding it to the existing CongestionExperienced variant makes all four RFC 3168 codepoints round-trip.

This lets downstream consumers (Firezone's ip-packet) rely on the typed Ecn field instead of reading the ECN bits raw.


Generated by Claude Code

@thomaseizinger
thomaseizinger force-pushed the claude/ip-packet-ingot-refactor-3wzbin branch 2 times, most recently from cebbfb2 to be8cca2 Compare July 17, 2026 04:44
FelixMcFelix and others added 4 commits July 20, 2026 10:10
This makes it far simpler to have something of the form:

```rust
let a: Option<MyEncap> = ...;
let b = H1 { ... };
let c = H2 { ... };
let body = b"hello"

let pkt = (a, b, c, &body[..]).emit_vec();
```
The most recent `darling` release required a compiler bump, so we move
up to 1.97.1 (i.e., the first rustc in a while that darling supports
without a latent miscompilation bug).

A new `syn` is a available, but this looks to have a pile of breasking
changes to consider.
`Ecn::from_network` and `Ecn::try_from` both mapped the wire value 3
(CE, "Congestion Experienced") to `Ecn::Capable0`, silently collapsing
the CE marking into ECT(1) on the next serialisation and dropping the
congestion signal. Decode it to the existing `Ecn::CongestionExperienced`
variant instead so all four RFC 3168 codepoints round-trip.
@thomaseizinger
thomaseizinger force-pushed the claude/ip-packet-ingot-refactor-3wzbin branch from be8cca2 to e63b00f Compare July 24, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants