Skip to content

Conversation

jvaclav-rh
Copy link

@jvaclav-rh jvaclav-rh commented Oct 7, 2025

This is a continuation of work done in #155, #167.

Resolves: https://issues.redhat.com/browse/NMT-1372

jvaclav-rh and others added 3 commits October 7, 2025 14:25
All these tunnels use the IFLA_IPTUN_* netlink API. Therefore, both
IFLAN_INFO_KIND "ipip" and "ip6tnl" data is serialized using the
IpTunnel struct.

Unit tests added.

Co-authored-by: Fernando Fernandez Mancera <[email protected]>
Co-authored-by: Wen Liang <[email protected]>
Signed-off-by: Jan Vaclav <[email protected]>
According to the IANA protocol number specification
(https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml),
protocol numbers are always within the u8 range.

Using `as` for type conversion is dangerous because it can silently
discard higher-order data, leading to bugs that are hard to detect.

This change ensures all protocol number conversions are type-safe and
explicit, avoiding accidental data loss and aligning the code with the
protocol specification.
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.

2 participants