Skip to content

Commit 5ce60dc

Browse files
committed
Check if interface is null before starting sequence.
1 parent bca5989 commit 5ce60dc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/sequence.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,18 @@ void *thread_hdl(void *temp)
711711
**/
712712
void seq_send(const char *interface, sequence_t seq, u16 seq_cnt2, cmd_line_t cmd)
713713
{
714-
// First, let's check if the destination IP is set.
714+
// First, make sure interface isn't NULL.
715+
if (interface == NULL)
716+
{
717+
fprintf(stderr, "Interface not set on sequence #%d. Not moving forward with this sequence.\n", seq_cnt2);
718+
719+
return;
720+
}
721+
722+
// Let's check if the destination IP is set.
715723
if (seq.ip.dst_ip == NULL)
716724
{
717-
fprintf(stdout, "Destination IP not set on sequence #%u. Not moving forward with this sequence.\n", seq_cnt2);
725+
fprintf(stderr, "Destination IP not set on sequence #%d. Not moving forward with this sequence.\n", seq_cnt2);
718726

719727
return;
720728
}

0 commit comments

Comments
 (0)