aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/pg/input.c
diff options
context:
space:
mode:
authorMaxime Peim <mpeim@cisco.com>2024-02-19 11:26:23 +0100
committerDave Barach <vpp@barachs.net>2024-02-20 17:20:43 +0000
commit7217dcdb54c8d66cec28ca71697b808099a7bd85 (patch)
tree2f65ecbbc005d014940fd3dbf94ed39da308000a /src/vnet/pg/input.c
parent088d1a0168cdf0e3ca651cf07012025ba6eab3fa (diff)
pg: fix stream pg interface
When an other interface is specified to generate packets from, we should bind its sw_if_index to the pg interface to use. Fix if_index_by_sw_if_index variable name, and force to specify a pg interface to source traffic from. Type: fix Change-Id: Ib3e6dca92774b307def82926fc09945b7998267d Signed-off-by: Maxime Peim <mpeim@cisco.com>
Diffstat (limited to 'src/vnet/pg/input.c')
-rw-r--r--src/vnet/pg/input.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vnet/pg/input.c b/src/vnet/pg/input.c
index 6f38ed0869a..f376c7443e5 100644
--- a/src/vnet/pg/input.c
+++ b/src/vnet/pg/input.c
@@ -1639,8 +1639,8 @@ pg_generate_packets (vlib_node_runtime_t * node,
pg_interface_t *pi;
int i;
- pi = pool_elt_at_index (pg->interfaces,
- pg->if_id_by_sw_if_index[s->sw_if_index[VLIB_RX]]);
+ pi = pool_elt_at_index (
+ pg->interfaces, pg->if_index_by_sw_if_index[s->sw_if_index[VLIB_RX]]);
bi0 = s->buffer_indices;
n_packets_in_fifo = pg_stream_fill (pg, s, n_packets_to_generate);
@@ -1864,9 +1864,9 @@ VLIB_NODE_FN (pg_input_mac_filter) (vlib_main_t * vm,
pg_interface_t *pi;
mac_address_t in;
- pi = pool_elt_at_index
- (pg->interfaces,
- pg->if_id_by_sw_if_index[vnet_buffer (b[0])->sw_if_index[VLIB_RX]]);
+ pi = pool_elt_at_index (
+ pg->interfaces,
+ pg->if_index_by_sw_if_index[vnet_buffer (b[0])->sw_if_index[VLIB_RX]]);
eth = vlib_buffer_get_current (b[0]);
mac_address_from_bytes (&in, eth->dst_address);