summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-10 08:48:55 +0000
committerDave Barach <openvpp@barachs.net>2019-07-12 12:28:24 +0000
commit43ba29267b1f1db04cba0af1f994a5c8477ca870 (patch)
treedfc06262a022481426467290ae7fb5e26518dc92 /src/vnet/ip
parentdeb582734773958a8fab888c98c2a5501d9bc819 (diff)
ip: Trace the packet from the punt node
Type: feature Change-Id: I01f1cc53efc93b0a7bb588ea6db89a53c971a3f5 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/punt_node.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/vnet/ip/punt_node.c b/src/vnet/ip/punt_node.c
index 65237aaaa0e..8a39d118a81 100644
--- a/src/vnet/ip/punt_node.c
+++ b/src/vnet/ip/punt_node.c
@@ -223,6 +223,7 @@ typedef struct
{
punt_client_t client;
u8 is_midchain;
+ u8 packet_data[64];
} udp_punt_trace_t;
static u8 *
@@ -238,6 +239,9 @@ format_udp_punt_trace (u8 * s, va_list * args)
s = format (s, "\n%U(buffer is part of chain)", format_white_space,
indent);
}
+ s = format (s, "\n%U%U", format_white_space, indent,
+ format_hex_bytes, t->packet_data, sizeof (t->packet_data));
+
return s;
}
@@ -327,13 +331,6 @@ punt_socket_inline (vlib_main_t * vm,
struct sockaddr_un *caddr = &c->caddr;
- if (PREDICT_FALSE (b->flags & VLIB_BUFFER_IS_TRACED))
- {
- udp_punt_trace_t *t;
- t = vlib_add_trace (vm, node, b, sizeof (t[0]));
- clib_memcpy_fast (&t->client, c, sizeof (t->client));
- }
-
/* Re-set iovecs */
vec_reset_length (ptd->iovecs);
@@ -350,6 +347,16 @@ punt_socket_inline (vlib_main_t * vm,
iov->iov_base = b->data + b->current_data;
iov->iov_len = l = b->current_length;
+ if (PREDICT_FALSE (b->flags & VLIB_BUFFER_IS_TRACED))
+ {
+ udp_punt_trace_t *t;
+ t = vlib_add_trace (vm, node, b, sizeof (t[0]));
+ clib_memcpy_fast (&t->client, c, sizeof (t->client));
+ clib_memcpy_fast (t->packet_data,
+ vlib_buffer_get_current (b),
+ sizeof (t->packet_data));
+ }
+
if (PREDICT_FALSE (b->flags & VLIB_BUFFER_NEXT_PRESENT))
{
do