I have written a script to send a UDP packet over IPv6 link local IP. Both source and destination are IPv6 link local IP.
#!/usr/bin/perl
use IO::Socket::INET6;
use Socket6;
my ($socket,$data);
$socket = new IO::Socket::INET6(
LocalAddr => 'fe80::21b:21ff:fe39:8cce',
LocalPort => '547',
PeerAddr => 'fe80::240:43ff:feb9:2f44',
PeerPort => '546',
Proto => 'udp',
) or die "ERROR in Socket Creation : $@\n";
for (my $i=1; $i <= 1; $i++) {
$data =pack('H*',"123455550");
$socket->send($data);
}
$socket->close();
After executing this above script I am getting below error:
ERROR in Socket Creation : IO::Socket::INET6: bind: Invalid argument
Any one please help me on this .