Skip to content

Commit

Permalink
test --print-tos with an IPv6 target
Browse files Browse the repository at this point in the history
Currently, --print-tos only works with IPv4.  In contrast
to IPv4, IPv6 raw sockets do not provide access to the
raw IP packet.  Thus the method used to access the TOS
byte value of an IPv4 packet does not work for the TC byte
value of an IPv6 packet.  This results in always generating
'(TOS unknown)' for IPv6 targets.
  • Loading branch information
auerswal committed Jul 28, 2024
1 parent 9b14d7f commit dda470a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ci/test-08-options-n-q.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/perl -w

use Test::Command tests => 42;
use Test::Command tests => 45;
use Test::More;

# -n show targets by name (-d is equivalent)
# -O n set the type of service (tos) flag on the ICMP packets
Expand Down Expand Up @@ -66,6 +67,17 @@
$cmd->stderr_is_eq("");
}

# fping --print-tos with IPv6
SKIP: {
if($ENV{SKIP_IPV6}) {
skip 'Skip IPv6 tests', 3;
}
my $cmd = Test::Command->new(cmd => "fping --print-tos ::1");
$cmd->exit_is_num(0);
$cmd->stdout_like(qr{::1 is alive \(TOS unknown\)\n});
$cmd->stderr_is_eq("");
}

# fping -q
{
my $cmd = Test::Command->new(cmd => "fping -q -p 100 -c 3 127.0.0.1");
Expand Down

0 comments on commit dda470a

Please sign in to comment.