From 0f150c2738f496a52cce712991af9ad737ef9254 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Wed, 4 Sep 2019 19:20:52 +0200 Subject: Fix generation through pcap file - When using "pcap file" argument in PROX config file in the gen mode (and no submode), packets were truncated to 8 bytes (and a warning printed) This has been fixed. - "Set value" command was checking whether offset was within first 1518 bytes unrespective to the mtu (e.g. jumbo packets). This has been fixed. - There was a limit of 64K packets loaded from a pcap file (which could be overwritten through PROX config). This limit has been removed - by default all packets from pcap are loaded - When pcap was loaded, memory was allocated to store the packet. However just enough memory was allocated, so that there was no way to change (increase) packet size through command line after that. Now memory is allocated to store up to mtu size - While "set value" command was acting on all packets, "pkt size" command was only changing the first packet. This has now been changed and both commands change all the packets. - A few other minor cleanups. Change-Id: I7264cee8d57e3e6a405dfd7e7a52a95b99399d99 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/cmd_parser.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'VNFs/DPPD-PROX/cmd_parser.c') diff --git a/VNFs/DPPD-PROX/cmd_parser.c b/VNFs/DPPD-PROX/cmd_parser.c index dea955f4..3ad5b534 100644 --- a/VNFs/DPPD-PROX/cmd_parser.c +++ b/VNFs/DPPD-PROX/cmd_parser.c @@ -692,9 +692,7 @@ static int parse_cmd_set_value(const char *str, struct input *input) if ((!task_is_mode_and_submode(lcore_id, task_id, "gen", "")) && (!task_is_mode_and_submode(lcore_id, task_id, "gen", "l3"))) { plog_err("Core %u task %u is not generating packets\n", lcore_id, task_id); } - else if (offset > ETHER_MAX_LEN) { - plog_err("Offset out of range (must be less then %u)\n", ETHER_MAX_LEN); - } + // do not check offset here - gen knows better than us the maximum frame size else if (value_len > 4) { plog_err("Length out of range (must be less then 4)\n"); } @@ -702,7 +700,7 @@ static int parse_cmd_set_value(const char *str, struct input *input) struct task_base *tbase = lcore_cfg[lcore_id].tasks_all[task_id]; if (task_gen_set_value(tbase, value, offset, value_len)) - plog_info("Unable to set Byte %"PRIu16" to %"PRIu8" - too many value set\n", offset, value); + plog_info("Unable to set Byte %"PRIu16" to %"PRIu8" - invalid offset/len\n", offset, value); else plog_info("Setting Byte %"PRIu16" to %"PRIu32"\n", offset, value); } -- cgit 1.2.3-korg