Skip to content

Fix #1095 preserve all fixed ipv4 fields#1099

Closed
aaronddavies wants to merge 12 commits into
smoltcp-rs:mainfrom
aaronddavies:1095-preserve-all-fixed-ipv4-fields
Closed

Fix #1095 preserve all fixed ipv4 fields#1099
aaronddavies wants to merge 12 commits into
smoltcp-rs:mainfrom
aaronddavies:1095-preserve-all-fixed-ipv4-fields

Conversation

@aaronddavies

@aaronddavies aaronddavies commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

This PR preserves the IPv4 fixed length fields that were being dropped. They are now parsed directly into the Ipv4Repr struct.

The exception is header length, which is always 20 bytes, until options support is implemented. Options is a variable length field that will be implemented in a separate PR.

Bench tests

develop @ 39cd44e
test wire::bench_emit_ipv4 ... bench:           8.07 ns/iter (+/- 0.18)
test wire::bench_emit_ipv6 ... bench:           1.12 ns/iter (+/- 0.01)
test wire::bench_emit_tcp  ... bench:          30.81 ns/iter (+/- 0.85)
test wire::bench_emit_udp  ... bench:          26.34 ns/iter (+/- 11.85)

1095-preserve-all-fixed-ipv4-fields @ 9c2b2c3
test wire::bench_emit_ipv4 ... bench:           8.52 ns/iter (+/- 0.19)
test wire::bench_emit_ipv6 ... bench:           1.13 ns/iter (+/- 0.03)
test wire::bench_emit_tcp  ... bench:          31.88 ns/iter (+/- 0.73)
test wire::bench_emit_udp  ... bench:          26.35 ns/iter (+/- 1.32)

@Dirbaio

Dirbaio commented Jan 30, 2026

Copy link
Copy Markdown
Member

i'm going to close this in favor of #1108 since that one seems more complete.

@Dirbaio Dirbaio closed this Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants