Skip to content

Commit

Permalink
Fix when use pktgen.seqTable() or pktgen.seq() in lua script
Browse files Browse the repository at this point in the history
When I use test/test_seq.lua,only update the first seqTable success.

pktgen.seqTable(1, '0', seq_table[1]);

This bug occurs when the second argument is of type string.

Signed-off-by: Cong Song <[email protected]>
  • Loading branch information
NinethDimension authored and pktgen committed Jan 17, 2025
1 parent 3094c5f commit 830f2c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/lpktgenlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pktgen_get_portlist(lua_State *L, int index)
portlist_t portlist;

if (lua_isstring(L, index)) {
if (portlist_parse(luaL_checkstring(L, 1), pktgen.nb_ports, &portlist) < 0)
if (portlist_parse(luaL_checkstring(L, index), pktgen.nb_ports, &portlist) < 0)
portlist = INVALID_PORTLIST;
} else if (lua_isnumber(L, index))
portlist = (uint64_t)lua_tonumber(L, index);
Expand Down

0 comments on commit 830f2c6

Please sign in to comment.