diff options
Diffstat (limited to 'src/plugins/flowprobe')
-rw-r--r-- | src/plugins/flowprobe/flowprobe.c | 9 | ||||
-rw-r--r-- | src/plugins/flowprobe/node.c | 7 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/flowprobe/flowprobe.c b/src/plugins/flowprobe/flowprobe.c index fb05158576e..af8b8ce5218 100644 --- a/src/plugins/flowprobe/flowprobe.c +++ b/src/plugins/flowprobe/flowprobe.c @@ -245,6 +245,7 @@ flowprobe_template_rewrite_inline (ipfix_exporter_t *exp, flow_report_t *fr, flowprobe_main_t *fm = &flowprobe_main; flowprobe_record_t flags = fr->opaque.as_uword; bool collect_ip4 = false, collect_ip6 = false; + bool collect_l4 = false; stream = &exp->streams[fr->stream_index]; @@ -257,6 +258,10 @@ flowprobe_template_rewrite_inline (ipfix_exporter_t *exp, flow_report_t *fr, if (which == FLOW_VARIANT_L2_IP6) flags |= FLOW_RECORD_L2_IP6; } + if (flags & FLOW_RECORD_L4) + { + collect_l4 = (which != FLOW_VARIANT_L2); + } field_count += flowprobe_template_common_field_count (); if (flags & FLOW_RECORD_L2) @@ -265,7 +270,7 @@ flowprobe_template_rewrite_inline (ipfix_exporter_t *exp, flow_report_t *fr, field_count += flowprobe_template_ip4_field_count (); if (collect_ip6) field_count += flowprobe_template_ip6_field_count (); - if (flags & FLOW_RECORD_L4) + if (collect_l4) field_count += flowprobe_template_l4_field_count (); /* allocate rewrite space */ @@ -304,7 +309,7 @@ flowprobe_template_rewrite_inline (ipfix_exporter_t *exp, flow_report_t *fr, f = flowprobe_template_ip4_fields (f); if (collect_ip6) f = flowprobe_template_ip6_fields (f); - if (flags & FLOW_RECORD_L4) + if (collect_l4) f = flowprobe_template_l4_fields (f); /* Back to the template packet... */ diff --git a/src/plugins/flowprobe/node.c b/src/plugins/flowprobe/node.c index 44096d6245f..8466eda3792 100644 --- a/src/plugins/flowprobe/node.c +++ b/src/plugins/flowprobe/node.c @@ -701,6 +701,7 @@ flowprobe_export_entry (vlib_main_t * vm, flowprobe_entry_t * e) ipfix_exporter_t *exp = pool_elt_at_index (flow_report_main.exporters, 0); vlib_buffer_t *b0; bool collect_ip4 = false, collect_ip6 = false; + bool collect_l4 = false; flowprobe_variant_t which = e->key.which; flowprobe_record_t flags = fm->context[which].flags; u16 offset = @@ -719,6 +720,10 @@ flowprobe_export_entry (vlib_main_t * vm, flowprobe_entry_t * e) collect_ip4 = which == FLOW_VARIANT_L2_IP4 || which == FLOW_VARIANT_IP4; collect_ip6 = which == FLOW_VARIANT_L2_IP6 || which == FLOW_VARIANT_IP6; } + if (flags & FLOW_RECORD_L4) + { + collect_l4 = (which != FLOW_VARIANT_L2); + } offset += flowprobe_common_add (b0, e, offset); @@ -728,7 +733,7 @@ flowprobe_export_entry (vlib_main_t * vm, flowprobe_entry_t * e) offset += flowprobe_l3_ip6_add (b0, e, offset); if (collect_ip4) offset += flowprobe_l3_ip4_add (b0, e, offset); - if (flags & FLOW_RECORD_L4) + if (collect_l4) offset += flowprobe_l4_add (b0, e, offset); /* Reset per flow-export counters */ |