Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the NetPacket CPAN distribution.

Report information
The Basics
Id: 20577
Status: rejected
Priority: 0/
Queue: NetPacket

People
Owner: yanick+cpan [...] babyl.dyndns.org
Requestors: krisodb [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.04
Fixed in: (no value)



Subject: IP options field -> if no options, not needed for pack in encode
Incase no option are passed for the IP header, it will give in some cases problems. As work around for myself, I've assumed I never pass any options so I removed everything releated to this optional field. sub encode ... # construct header to calculate the checksum $hdr = pack('CCnnnCCna4a4', $tmp, $self->{tos},$self->{len}, $self->{id}, $offset, $self->{ttl}, $self->{proto}, $zero, $src_ip, $dest_ip); $self->{cksum} = NetPacket::htons(NetPacket::in_cksum($hdr)); # make the entire packet $packet = pack('CCnnnCCna4a4a*', $tmp, $self->{tos},$self->{len}, $self->{id}, $offset, $self->{ttl}, $self->{proto}, $self->{cksum}, $src_ip, $dest_ip, $self->{data}); A better solution would be to check if options are present, and depending on the outcome include it in the pack or not.
On Thu Jul 20 09:07:28 2006, kob wrote: Show quoted text
> Incase no option are passed for the IP header, it will give in some > cases problems.
Can you provide an example of such a corner case problem? `/anick
No example provided. Closing ticket.