diff options
author | Alexander Chernavin <achernavin@netgate.com> | 2020-01-15 06:45:47 -0500 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-08-12 15:59:46 +0000 |
commit | e77501695957f838b115572106d768f58cb11433 (patch) | |
tree | 5f01549735cf53a765d40f25cdcc91961810cf34 /src | |
parent | 0cd8e2c59a3cf53f1e58fe989ffa742fe320bbce (diff) |
ip6: during icmp to icmp6 translation truncate error messages
All translated ICMPv6 packets that exceed the minimal IPv6 MTU get
truncated but according to RFC 4443 2.4 only ICMPv6 error messages
(type < 128) need to be truncated.
With this commit, truncate only ICMPv6 error messages.
Type: fix
Change-Id: Ic455352de2ff4ff6aa3421b46a2a54923f2d3f80
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit 180210f99b74b97b127b7800bdc7bd243713cbf4)
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/ip/ip4_to_ip6.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vnet/ip/ip4_to_ip6.h b/src/vnet/ip/ip4_to_ip6.h index b1905e4154b..e806c504ce7 100644 --- a/src/vnet/ip/ip4_to_ip6.h +++ b/src/vnet/ip/ip4_to_ip6.h @@ -414,8 +414,8 @@ icmp_to_icmp6 (vlib_buffer_t * p, ip4_to_ip6_set_fn_t fn, void *ctx, if ((rv = fn (ip4, ip6, ctx)) != 0) return rv; - //Truncate when the packet exceeds the minimal IPv6 MTU - if (p->current_length > 1280) + //Truncate when ICMPv6 error message exceeds the minimal IPv6 MTU + if (p->current_length > 1280 && icmp->type < 128) { ip6->payload_length = clib_host_to_net_u16 (1280 - sizeof (*ip6)); p->current_length = 1280; //Looks too simple to be correct... |