I have faced a problem while using Net::RawIP module, I thought that it is not the problem with Net::RawIP module itself and the problem lies with my setup and the way that I use it, so I am posting it here.
I am reading a wireshark dump file using Net::Pcap module,
and I am dumping only the packet to the ethernet interface, using Net::RawIP's bset and send.
I works for some dump files and not for other dump files, it is showing this error
PROBLEM OUTPUT 1
$VAR1 = { 'len' => 74, 'tv_usec' => 134541, 'tv_sec' => 1235622359, 'caplen' => 74 }; >#®w;!áüE<²@ÿjP ùPZ(Ñ0Hk½9å r[àçÚÌ«½UZP<2E5÷B< panic: sv_setpvn called with negative strlen at /usr/local/lib/perl/5.8.8/Net/RawIP.pm line 500 (#1) (P) An internal error. ^[[?1;2cUncaught exception from user code: panic: sv_setpvn called with negative strlen at /usr/local/lib +/perl/5.8.8/Net/RawIP.pm line 500. at /usr/local/lib/perl/5.8.8/Net/RawIP.pm line 500 Net::RawIP::bset('Net::RawIP=HASH(0x814ec28)', '\x{0}#\x{4}\x{ +ae}w;\x{0}!\x{e1}\x{fc}\x{9f}\x{f1}\x{8}\x{0}E\x{0}\x{0}<\x{7}\x{b2}\ +x{0}\x{0}@\x{11}\x{ff}j\x{14}\x{1}P\x{1b}\x{a}\x{80}\x{4}\x{f9}\x{14} +P\x{14}Z\x{0}(\x{d1}0\x{80}\x{12}\x{93}Hk\x{bd}9\x{e5}\x{9}\x{9f}r[\x +{e0}\x{e7}\x{da}\x{5}\x{cc}\x{ab}\x{11}...', 'eth0') called at readpc +ap.pl line 48 main::handlepacket('Testing', 'HASH(0x840a63c)', '\x{0}#\x{4}\ +x{ae}w;\x{0}!\x{e1}\x{fc}\x{9f}\x{f1}\x{8}\x{0}E\x{0}\x{0}<\x{7}\x{b2 +}\x{0}\x{0}@\x{11}\x{ff}j\x{14}\x{1}P\x{1b}\x{a}\x{80}\x{4}\x{f9}\x{1 +4}P\x{14}Z\x{0}(\x{d1}0\x{80}\x{12}\x{93}Hk\x{bd}9\x{e5}\x{9}\x{9f}r[ +\x{e0}\x{e7}\x{da}\x{5}\x{cc}\x{ab}\x{11}...') called at readpcap.pl +line 33

I also checked that for some dump files the capture length was 1500 and for the other the capture length was 65535 (I found it by using file utility in my unix based system). for those files which has capture length of 65535 the net::rawip is saying this error
PROBLEM OUTPUT 2

$VAR1 = { 'len' => 60, 'tv_usec' => 958875, 'tv_sec' => 1235629906, 'caplen' => 60 }; >Â>ðÌ>ð>ð x< Uncaught exception from user code: sendto() at /usr/lib/perl5/Net/RawIP.pm line 550. at /usr/lib/perl5/Net/RawIP.pm line 550 Net::RawIP::send('Net::RawIP=HASH(0x814ec28)') called +at readpcap.pl line 52 main::handlepacket('Testing', 'HASH(0x8410004)', '\x{1 +}\x{80}\x{c2}\x{0}\x{0}\x{e}\x{0}\x{14}\x{e}>\x{f0}\x{0}\x{88}\x{cc}\ +x{2}\x{7}\x{4}\x{0}\x{14}\x{e}>\x{f0}\x{1}\x{4}\x{7}\x{3}\x{0}\x{14}\ +x{e}>\x{f0}\x{b}\x{6}\x{2}\x{0}x\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x +{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\ +x{0}\x{0}\x{0}') called at readpcap.pl line 35
for the second problem I tried increasing the MTU of ethernet interface from 1500 to 65535 but it is saying error

command: "ifconfig eth2 mtu 65535"
output: "SIOCSIFMTU: Invalid argument"

Any idea about this error and any suggestions to track this problem will be helpful to me.


Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.

In reply to Net::RawIP failing in some case by targetsmart

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.