Skip to content

Conversation

jvaclav-rh
Copy link
Contributor

@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 <ffmancera@riseup.net>
Co-authored-by: Wen Liang <liangwen12year@gmail.com>
Signed-off-by: Jan Vaclav <jvaclav@redhat.com>
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.
Signed-off-by: Jan Vaclav <jvaclav@redhat.com>
@cathay4t cathay4t merged commit cee37d1 into rust-netlink:main Oct 11, 2025
9 checks passed
@jvaclav-rh jvaclav-rh deleted the ipip-support branch October 13, 2025 08:45
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