mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-23 17:30:29 +01:00
bpf: clat: fix translation of ICMPv6 Parameter Problem
According to RFC 6145 5.2, the pointer should be set for code 0, not 1.
This commit is contained in:
parent
80bba04baa
commit
d209e01442
1 changed files with 6 additions and 5 deletions
|
|
@ -468,14 +468,11 @@ rewrite_icmpv6(struct ipv6hdr *ip6h,
|
|||
case 0:
|
||||
icmp.type = ICMP_PARAMETERPROB;
|
||||
icmp.code = 0;
|
||||
break;
|
||||
case 1:
|
||||
icmp.type = ICMP_DEST_UNREACH;
|
||||
icmp.code = ICMP_PROT_UNREACH;
|
||||
ptr = bpf_ntohl(icmp6->icmp6_pointer);
|
||||
|
||||
/* Figure 6 in RFC6145 - using if statements b/c of
|
||||
* range at the bottom
|
||||
*/
|
||||
ptr = bpf_ntohl(icmp6->icmp6_pointer);
|
||||
if (ptr == 0 || ptr == 1)
|
||||
icmp.un.reserved[0] = ptr;
|
||||
else if (ptr == 4 || ptr == 5)
|
||||
|
|
@ -491,6 +488,10 @@ rewrite_icmpv6(struct ipv6hdr *ip6h,
|
|||
else
|
||||
return -1;
|
||||
break;
|
||||
case 1:
|
||||
icmp.type = ICMP_DEST_UNREACH;
|
||||
icmp.code = ICMP_PROT_UNREACH;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue