summaryrefslogtreecommitdiffstats
path: root/src/plugins/snort/enqueue.c
diff options
context:
space:
mode:
authorSivaprasad Tummala <Sivaprasad.Tummala@intel.com>2022-01-22 03:09:18 +0530
committerDamjan Marion <dmarion@me.com>2022-01-30 15:20:38 +0000
commitc454e8993d18670f76b03dca780213860c2e19a2 (patch)
tree22d84f0047a8d746fabd58709e4553960644e84c /src/plugins/snort/enqueue.c
parent9d0c638b0fa28b9aebd9e3c0c0bdf98361d50a50 (diff)
snort: feature support on interface output
support snort plugin on interface output via ip4-output fa Type: feature Signed-off-by: Sivaprasad Tummala <Sivaprasad.Tummala@intel.com> Change-Id: I2d5e7d0719c03f88806b12debfe596675dbd66c1
Diffstat (limited to 'src/plugins/snort/enqueue.c')
-rw-r--r--src/plugins/snort/enqueue.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/snort/enqueue.c b/src/plugins/snort/enqueue.c
index 3f44e8013fd..147d3a4a67b 100644
--- a/src/plugins/snort/enqueue.c
+++ b/src/plugins/snort/enqueue.c
@@ -75,9 +75,16 @@ snort_enq_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
while (n_left)
{
+ u64 fa_data;
u32 instance_index, next_index, n;
- instance_index =
- *(u32 *) vnet_feature_next_with_data (&next_index, b[0], sizeof (u32));
+ u32 l3_offset;
+
+ fa_data =
+ *(u64 *) vnet_feature_next_with_data (&next_index, b[0], sizeof (u64));
+
+ instance_index = (u32) (fa_data & 0xffffffff);
+ l3_offset =
+ (fa_data >> 32) ? vnet_buffer (b[0])->ip.save_rewrite_length : 0;
si = vec_elt_at_index (sm->instances, instance_index);
/* if client isn't connected skip enqueue and take default action */
@@ -108,7 +115,7 @@ snort_enq_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
/* fill descriptor */
d->buffer_pool = b[0]->buffer_pool_index;
d->length = b[0]->current_length;
- d->offset = (u8 *) b[0]->data + b[0]->current_data -
+ d->offset = (u8 *) b[0]->data + b[0]->current_data + l3_offset -
sm->buffer_pool_base_addrs[d->buffer_pool];
d->address_space_id = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
}