ICMP46 error: Clone first buffer instead of "truncating" original buffer 83/18183/6
authorOle Troan <ot@cisco.com>
Mon, 11 Mar 2019 12:15:54 +0000 (13:15 +0100)
committerDamjan Marion <dmarion@me.com>
Tue, 12 Mar 2019 15:30:20 +0000 (15:30 +0000)
commitda7f7b6164e976a97ff0afb13f488c60461402bc
treee89bab0df37f10d078524507fd7e38eba2692ee8
parent5995482d310c97616beea2d5002943745b453515
ICMP46 error: Clone first buffer instead of "truncating" original buffer

Previous code was walked buffer chain, effectively trying to "truncate" the chain, reset the
length of first buffer and reused that as the ICMP error message. That could have issues in cases
there were other users of the buffer chain. Update to clone the first buffer in chain, and
use that for the ICMP error message instead.

Change-Id: Ibc1a0bf2d854dae41874808c8297028ed93dd69d
Signed-off-by: Ole Troan <ot@cisco.com>
src/vlib/buffer_funcs.h
src/vnet/ip/icmp4.c
src/vnet/ip/icmp6.c