Hi again, yes, I am considering the idea of donating something,I have good memories linked to Perl, since the start of this summer I started writing some articles for the perl.com, I am still waiting the publication, hope soon. I am writing again because the "enemy" strickes back, while I was testing the lorcon_create I tried to put everything into the "new" subroutine for the function initialization, the code is as follows:
sub new { my (undef, undef, $interface, undef, $driver) = @_; my $self = shift->SUPER::new( driver => $driver, interface => $interface, @_, ); my $drv = lorcon_find_driver($self->driver); if (! $drv) { die "[*] new: lorcon_find_driver: failed\n"; return; } $self->driver( $drv ); my $context = lorcon_create($self->interface, $drv); #_drv if (! $context) { die "[*] new: lorcon_create: failed\n"; return; } $self->_context($context) or die $!; return $self; }
the only big problem stands when I tried to call the setInjectMode it produces a core dump (again). the code is:
sub setInjectMode { my $self = shift; my $r = lorcon_open_inject($self->_context);#->_context); if ($r == -1) { die "[*] setInjectMode: lorcon_open_inject: " . lorcon_get_error +( $self->_context ) . "\n"; return; } return 1; }
I think that there is something wrong in the $self->_context variable, perhaps I haven't understood the use of "_context" **update** dumping the Lorcon initialization variable the result was:
$VAR1 = bless( [ \152150320, 'wlo1', undef, \152168944 ], 'Net::Lorcon2' );
I think that the "undef" is referred to the _drv, the \152150320 is the $driver. the \152150320 changes to 'madwifing' modifyng those 2 lines
# $self->driver( $drv ) ; my $context = lorcon_create($self->interface, $drv); #_drv
regards Edoardo M.

In reply to Re^10: Help with Lorcon XS library by Bpl
in thread Help with Lorcon XS library by Bpl

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.