Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Commit 3b9223c

Browse files
committed
Fix payload not setting when specified through command line.
1 parent 97177ae commit 3b9223c

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

src/cmd_line.c

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -352,36 +352,41 @@ void parse_cli(cmd_line_t *cmd, config_t *cfg)
352352
seq->icmp.type = cmd->icmp_type;
353353
}
354354

355-
struct payload_opt *pl = &seq->pls[0];
356-
357-
if(cmd->is_pl_min_len)
355+
if (cmd->is_pl_min_len || cmd->is_pl_max_len || cmd->is_pl_exact)
358356
{
359-
pl->min_len = cmd->pl_min_len;
360-
}
357+
seq->pl_cnt = 1;
358+
359+
struct payload_opt *pl = &seq->pls[0];
361360

362-
if(cmd->is_pl_max_len)
363-
{
364-
pl->max_len = cmd->pl_max_len;
365-
}
361+
if(cmd->is_pl_min_len)
362+
{
363+
pl->min_len = cmd->pl_min_len;
364+
}
366365

367-
if(cmd->is_pl_is_static)
368-
{
369-
pl->is_static = cmd->pl_is_static;
370-
}
366+
if(cmd->is_pl_max_len)
367+
{
368+
pl->max_len = cmd->pl_max_len;
369+
}
371370

372-
if (cmd->pl_exact != NULL && cmd->is_pl_exact)
373-
{
374-
pl->exact = cmd->pl_exact;
375-
}
371+
if(cmd->is_pl_is_static)
372+
{
373+
pl->is_static = cmd->pl_is_static;
374+
}
376375

377-
if(cmd->is_pl_is_file)
378-
{
379-
pl->is_file = cmd->pl_is_file;
380-
}
376+
if (cmd->pl_exact != NULL && cmd->is_pl_exact)
377+
{
378+
pl->exact = cmd->pl_exact;
379+
}
381380

382-
if(cmd->is_pl_is_string)
383-
{
384-
pl->is_string = cmd->pl_is_string;
381+
if(cmd->is_pl_is_file)
382+
{
383+
pl->is_file = cmd->pl_is_file;
384+
}
385+
386+
if(cmd->is_pl_is_string)
387+
{
388+
pl->is_string = cmd->pl_is_string;
389+
}
385390
}
386391
}
387392

0 commit comments

Comments
 (0)