This is my current code. I have also tried declaring the header data
inside the constructor, with no change.
my $fdp = Net::RawIP->new({udp =>{}});
$fdp->set({
ip => {
saddr => $ip->{dest_ip},
daddr => $ip->{src_ip}
},
udp => {
source => $udp->{dest_port},
dest => $udp->{src_port},
data => $payload
}});
Илья Рассадин <[email protected]> writes:
> Hi!
>
> According to Net::RawIP docs, checksum will be calculated
> automatically unless your provide it manually via "check" parameter
> during object construction.
>
> So my guess is you incorrectly construct Net::RawIP objects. But it's
> a sort of guesswork, so it'll be much easier to help if You send a
> piece of code to illustrate the problem.
>
>
> 21.08.16 17:31, Mitescu George Dan пишет:
>> Hello,
>>
>> I am trying to use Net::RawIP in order to craft UDP packets, which have
>> a custom source ip. The packets get sent, but tcpdump reports that the
>> checksum which is automatically computed (according to the docs) is
>> incorrect.
>>
>> There is a single post about this issue on perlmonks, I've also seen
>> examples on the internet using Net::RawIP for this, so I've figured
>> that I might be doing something wrong. I also remember Net::RawIP
>> complain about being compiled for a different Perl version, but I've
>> solved that by deleting perl5/site_perl/RawIP* and reinstalling the
>> cpan module.
>>
>> You can also give me suggestions about other modules which are as easy
>> to use as this one for changing the source address. :D
>>
>> Regards,
>> Mitescu George Dan
>>
>>
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/