willambender has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks. I'm having a bit of a problem with Net::RawIP and getting the proper ip/udp checksum to generate correctly. According to the documentation, setting "check => 0" would result in the checksum being calculated automatically. I've been trying different combinations of options (setting len, ttl, tos, etc..) with no luck. What am i missing ?
Thanks for any/all help.
- Will.
use Net::RawIP; my $packet = new Net::RawIP({udp=>{check => 0}}); $packet->set({ ip => { saddr => "192.168.10.10", daddr => "192.168.10.20" }, udp => { source => 6544, dest => 514, data => 'test123' } }); $packet->send;
tcpdump shows:
Tested on FreeBSD 9.1 and Net-RawIP-0.25,113:24:07.572481 IP (tos 0x10, ttl 55, id 45453, offset 0, flags [DF], +proto UDP (17), length 35) 192.168.10.10.6544 > 192.168.10.20.514: [bad udp cksum 8!] [|syslo +g]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::RawIP - invalid checksum ?
by VinsWorldcom (Prior) on Dec 07, 2013 at 02:04 UTC | |
by willambender (Initiate) on Dec 07, 2013 at 02:28 UTC | |
by VinsWorldcom (Prior) on Dec 07, 2013 at 11:42 UTC | |
|
Re: Net::RawIP - invalid checksum ?
by taint (Chaplain) on Dec 06, 2013 at 20:10 UTC | |
by willambender (Initiate) on Dec 06, 2013 at 21:10 UTC | |
by taint (Chaplain) on Dec 06, 2013 at 22:11 UTC | |
by willambender (Initiate) on Dec 06, 2013 at 22:18 UTC |