Skip to content

iptun: add support to ipip, ipip6 and ip6ip6 tunnels #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ffmancera
Copy link
Contributor

All these tunnels use the IFLA_IPTUN_* netlink API. Therefore, both IFLAN_INFO_KIND "ipip" and "ip6tnl" data is serialized using the IpTun struct.

Unit tests added.

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.

Signed-off-by: Fernando Fernandez Mancera <[email protected]>
}

impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'a T>> for InfoIpTunnel {
fn parse(buf: &NlaBuffer<&'a T>) -> Result<Self, DecodeError> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do ParseableParametrized with InfoKind as argument because IFLA_IPTUN_FLAGS has different size:

net/ipv6/ip6_tunnel.c
1992:	if (data[IFLA_IPTUN_FLAGS])
1993:		parms->flags = nla_get_u32(data[IFLA_IPTUN_FLAGS]);
2099:		/* IFLA_IPTUN_FLAGS */
2129:	    nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
2165:	[IFLA_IPTUN_FLAGS]		= { .type = NLA_U32 },

net/ipv6/sit.c
1664:		/* IFLA_IPTUN_FLAGS */
1704:	    nla_put_be16(skb, IFLA_IPTUN_FLAGS,
1744:	[IFLA_IPTUN_FLAGS]		= { .type = NLA_U16 },

@cathay4t cathay4t added the Wait_Submitter PR reviewed with change requests label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Wait_Submitter PR reviewed with change requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants