bpf: clat: use the right endian-conversion function

bpf_ntohl() is more correct because the field is in network byte
order; but there is no actual change in behavior.
This commit is contained in:
Beniamino Galvani 2025-12-23 22:11:29 +01:00
parent 7c89e7f19b
commit 51690d5f48

View file

@ -455,7 +455,7 @@ rewrite_icmpv6(struct ipv6hdr *ip6h,
icmp.type = ICMP_DEST_UNREACH;
icmp.code = ICMP_FRAG_NEEDED;
mtu = bpf_htonl(icmp6->icmp6_mtu) - 20;
mtu = bpf_ntohl(icmp6->icmp6_mtu) - 20;
if (mtu > 0xffff)
return -1;
icmp.un.frag.mtu = bpf_htons(mtu);