From 0b6a857d85df97e887de7aaf00fd6bd2dae39bf8 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Wed, 30 Oct 2019 17:34:14 +0000 Subject: ip: Fragmentation fixes Type: fix if the packet is about to be fragmented, then don't call any of the actions that expect the rewrite to have been written. 1) don't double count packets thru the adjacency (original & fragments) 2) don't double decrement the TTL for fragments 3) return to ip4-midchain post ip-frag if that's where we started. 4) only run midchain/mcast fixups if not fragmenting (if no errors) Change-Id: Ib2866787a42713ee5871b87b597d8f74b901044b Signed-off-by: Neale Ranns --- src/vnet/interface_output.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vnet/interface_output.h') diff --git a/src/vnet/interface_output.h b/src/vnet/interface_output.h index 58f7f617957..f1fa4d85b5e 100644 --- a/src/vnet/interface_output.h +++ b/src/vnet/interface_output.h @@ -62,7 +62,6 @@ calc_checksums (vlib_main_t * vm, vlib_buffer_t * b) if (is_ip4) { - ip4 = (ip4_header_t *) (b->data + vnet_buffer (b)->l3_hdr_offset); if (b->flags & VNET_BUFFER_F_OFFLOAD_IP_CKSUM) ip4->checksum = ip4_header_checksum (ip4); if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM) @@ -71,7 +70,10 @@ calc_checksums (vlib_main_t * vm, vlib_buffer_t * b) th->checksum = ip4_tcp_udp_compute_checksum (vm, b, ip4); } if (b->flags & VNET_BUFFER_F_OFFLOAD_UDP_CKSUM) - uh->checksum = ip4_tcp_udp_compute_checksum (vm, b, ip4); + { + uh->checksum = 0; + uh->checksum = ip4_tcp_udp_compute_checksum (vm, b, ip4); + } } if (is_ip6) { -- cgit 1.2.3-korg