aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-11-08 04:13:49 +0100
committerNeale Ranns <nranns@cisco.com>2017-12-08 13:56:03 +0000
commitb716308ca558e8fcc1297903bf78c1673af44154 (patch)
treeb35ed46f32f33f8b8944d2a9824ff6796257e45a /src
parent0708515198710c713fdd07f5519e1fb6ea594948 (diff)
punt: fix tracing for partially traced chains
This fixes a crash if the first buffer in buffer chain is not traced, but some other buffer (mid-chain) is. Change-Id: I2c9f529ae0bc3263d20981e0cb83ce24ed292bd8 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/ip/punt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vnet/ip/punt.c b/src/vnet/ip/punt.c
index 6a8f4513a3c..db3ea332fbd 100644
--- a/src/vnet/ip/punt.c
+++ b/src/vnet/ip/punt.c
@@ -360,10 +360,7 @@ udp46_punt_socket_inline (vlib_main_t * vm,
punt_client_t *c = NULL;
if (PREDICT_FALSE (b->flags & VLIB_BUFFER_IS_TRACED))
{
- if (!c)
- {
- c = punt_client_get (is_ip4, port);
- }
+ c = punt_client_get (is_ip4, port);
udp_punt_trace_t *t;
t = vlib_add_trace (vm, node, b, sizeof (t[0]));
clib_memcpy (&t->client, c, sizeof (t->client));
@@ -393,6 +390,10 @@ udp46_punt_socket_inline (vlib_main_t * vm,
b = vlib_get_buffer (vm, b->next_buffer);
if (PREDICT_FALSE (b->flags & VLIB_BUFFER_IS_TRACED))
{
+ if (PREDICT_FALSE (!c))
+ {
+ c = punt_client_get (is_ip4, port);
+ }
udp_punt_trace_t *t;
t = vlib_add_trace (vm, node, b, sizeof (t[0]));
clib_memcpy (&t->client, c, sizeof (t->client));