Subject: | SYNOPSIS code throws an error |
This code from the SYNOPSIS throws the following error:
use Net::Frame::Simple;
use Net::Frame::Layer::ICMPv6 qw(:consts);
my $icmp = Net::Frame::Layer::ICMPv6->new(
type => NF_ICMPv6_TYPE_ECHO_REQUEST,
code => NF_ICMPv6_CODE_ZERO,
checksum => 0,
);
# Build an ICMPv6 echo-request
use Net::Frame::Layer::ICMPv6::Echo;
my $echo = Net::Frame::Layer::ICMPv6::Echo->new(payload => 'echo');
my $echoReq = Net::Frame::Simple->new(layers => [ $icmp, $echo ]);
print $echoReq->print."\n";
Can't call method "dst" on an undefined value at /home/ahartmai/perl5/perlbrew/perls/26.1/lib/site_perl/5.26.1/Net/Frame/Layer/ICMPv6.pm line 213.
I'm trying to send ICMPv6 echo request packets through a raw socket and want to use this module for crafting the packets and also for parsing the responses.
My current workaround is to send $icmp->pack . $echo->pack which works but isn't very nice code.