Dearest Monks

A colleague of mine has a test script that he uses to send ICMP ping packets for monitorning purposes. The script can be shortened to a one-liner like the following:

perl -MNet::Ping -MTime::HiRes -le ' my $p=Net::Ping->new("icmp",3,3,"bge0") ; $p->hires() ; @r=$p->ping("10.39.15.20"); print "[$r[0]] [$r[1]]"'

Now, everything works on a couple of different Linux distributions, but on Solaris it dies with an error:

error binding to device bge0 Option not supported by protocol at -e line 1

Needless to say, everything works fine if he doesn't specify the network interface. The problem is that he needs to, since he needs to test connectivity from both. I took a look at Net::Ping's code and the problem happens with a setsockopt call, but it seems so weird that no one noticed before...

Is anybody out there aware of a Solaris-specific bug of the module? I tried an handful of searches here and there (google, rt.cpan.org, perlmonks...) but none gave relevant results.

Thanks in advance

Ciao!
--bronto


In theory, there is no difference between theory and practice. In practice, there is.

In reply to Net::Ping broken on Solaris? by bronto

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.