bpf: clat: fix translation of ICMPv6 Parameter Problem message

This commit is contained in:
Beniamino Galvani 2025-12-23 21:54:03 +01:00
parent 481b7f2f59
commit 20ffe2be9d

View file

@ -603,11 +603,8 @@ rewrite_icmpv6(struct __sk_buff *skb)
case 0:
icmp_buf.type = ICMP_PARAMETERPROB;
icmp_buf.code = 0;
break;
case 1:
icmp_buf.type = ICMP_DEST_UNREACH;
icmp_buf.code = ICMP_PROT_UNREACH;
ptr = bpf_ntohl(icmp6->icmp6_pointer);
ptr = bpf_ntohl(icmp6->icmp6_pointer);
/* Figure 6 in RFC6145 - using if statements b/c of
* range at the bottom
*/
@ -626,6 +623,10 @@ rewrite_icmpv6(struct __sk_buff *skb)
else
return -1;
break;
case 1:
icmp_buf.type = ICMP_DEST_UNREACH;
icmp_buf.code = ICMP_PROT_UNREACH;
break;
default:
return -1;
}